forked from chrisgrieser/obsidian-divide-and-conquer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc
109 lines (93 loc) · 3.34 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
{
"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"] }],
//-----------------------------------
//-----------------------------------
//-----------------------------------
// Variables
"camelcase": ["error", {"properties": "always", "ignoreImports": true}],
"no-var": "error",
"prefer-const": "warn",
"sort-vars": "warn",
"no-use-before-define": "error",
"no-multi-assign": "error",
"no-sequences": "error",
"no-undefined": "error",
"one-var-declaration-per-line": ["error", "initializations"],
// Regex
"prefer-regex-literals": ["error", {"disallowRedundantWrapping": true}],
// Spacing
"no-mixed-spaces-and-tabs": "warn",
"no-empty-function": "warn",
"indent": ["warn", "tab", { "SwitchCase": 1 } ],
"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",
"no-empty": "warn",
"arrow-spacing": "warn",
"keyword-spacing": "warn",
"spaced-comment": ["warn", "always", { "exceptions": ["-", "_"] }],
// Line Breaks
"object-curly-newline": ["warn", { "multiline": true }],
"newline-per-chained-call": ["error", { "ignoreChainWithDepth": 2 }],
"no-multiple-empty-lines": ["warn", { "max": 2 } ],
// Brackets
"no-extra-parens": ["warn", "all", { "returnAssign": false }],
"curly": ["warn", "multi-or-nest"],
// Arrays
"array-callback-return": ["error", { "checkForEach": false, "allowImplicit": true }],
// Loops
"no-unmodified-loop-condition": "error",
"no-unreachable-loop": "error",
"no-await-in-loop": "error",
// async/await
"require-atomic-updates": "error",
// return
"no-useless-return": "error",
// Semicolon & Comma
"no-extra-semi": "warn",
"semi-style": ["error", "last"],
"semi": ["warn", "always", {"omitLastInOneLineBlock": true }],
"comma-spacing": "warn",
"comma-style": "warn",
"comma-dangle": ["error", {"arrays": "never", "objects": "only-multiline" }],
// Strings & Numbers
"quotes": ["warn", "double", {"avoidEscape": true}],
"no-useless-concat": "warn",
"no-multi-str": "error",
"no-magic-numbers": ["error", { "ignore": [-9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 100, 1000, 10000], "ignoreArrayIndexes": true }],
"no-floating-decimal": "warn",
"no-implicit-coercion": "error",
// Conditions
"eqeqeq" : "error",
"no-eq-null" : "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",
// Imports
"no-duplicate-imports": "warn",
"sort-imports": "warn",
// Misc
"dot-notation": "error"
}
}