-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc
83 lines (73 loc) · 2.48 KB
/
.eslintrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"parserOptions": {"sourceType": "module"},
"rules": {
// specifically for Obsidian Plugins
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-extra-semi": "warn",
"@typescript-eslint/no-empty-function": "warn",
"no-shadow": ["error", { "builtinGlobals": true, "hoist": "all", "allow": ["Editor"] }],
//-----------------------------------
//-----------------------------------
//-----------------------------------
// Variable naming
"camelcase": ["error", {"properties": "always", "ignoreImports": true}],
"no-var": "error",
"prefer-const": "warn",
"vars-on-top": "warn",
"sort-vars": "warn",
// Tabs / Spaces
"no-mixed-spaces-and-tabs": "warn",
"no-empty-function": "warn",
"indent": ["warn", "tab"],
"no-multi-spaces": "warn",
"array-bracket-spacing": "warn",
"space-before-blocks": "warn",
"semi-spacing": "warn",
"object-curly-spacing": ["warn", "always"],
"no-whitespace-before-property": "error",
// Spacing
"no-empty": "warn",
"arrow-spacing": "warn",
"keyword-spacing": "warn",
"spaced-comment": ["warn", "always", { "exceptions": ["-", "_"] }],
"comma-spacing": "warn",
"comma-style": "warn",
"comma-dangle": ["error", {
"arrays": "never",
"objects": "only-multiline",
}],
"object-curly-newline": ["error", { "multiline": true }],
"curly": ["warn", "multi-or-nest", "consistent"],
"no-multiple-empty-lines": ["warn", { "max": 2 }],
// Semicolon
"no-extra-semi": "warn",
"semi-style": ["error", "last"],
"semi": ["warn", "always", {"omitLastInOneLineBlock": true }],
// Strings
"quotes": ["warn", "double"],
"no-useless-concat": "warn",
"no-multi-str": "error",
// Numbers
"no-magic-numbers": ["error", { "ignore": [-4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9], "ignoreArrayIndexes": true }],
"no-floating-decimal": "warn",
// Conditions
"eqeqeq" : "error",
"no-negated-condition": "error",
"no-unneeded-ternary": "error",
"no-nested-ternary": "error",
"yoda": "warn",
"no-mixed-operators": "error",
"no-else-return": ["error", { "allowElseIf": false} ],
"no-lonely-if": "error",
// Misc
"dot-notation": "error",
}
}