-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
252 lines (248 loc) · 7.55 KB
/
eslint.config.js
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
const unicorn = require("eslint-plugin-unicorn")
const sonarjs = require("eslint-plugin-sonarjs")
const stylistic = require("@stylistic/eslint-plugin-js")
module.exports = [
{
linterOptions: {
reportUnusedDisableDirectives: "error"
},
languageOptions: {
globals: {
fetch: "readonly",
setTimeout: "readonly",
Response: "readonly"
},
parser: require("@typescript-eslint/parser")
},
files: ["src/*.ts"],
plugins: {
unicorn,
sonarjs,
"@stylistic/js": stylistic
},
rules: {
"array-callback-return": 2,
"block-scoped-var": 2,
"default-case-last": 2,
"default-param-last": 2,
"dot-notation": 2,
"func-name-matching": 2,
"func-style": 2,
"no-array-constructor": 2,
"no-compare-neg-zero": 2,
"no-const-assign": 2,
"no-constructor-return": 2,
"no-dupe-args": 2,
"no-dupe-keys": 2,
"no-duplicate-case": 2,
"no-div-regex": 2,
"no-eq-null": 2,
"no-extra-boolean-cast": [2, {enforceForInnerExpressions: true}],
"no-extra-bind": 2,
"no-extend-native": 2,
"no-empty-pattern": 2,
"no-duplicate-imports": 2,
"no-fallthrough": 2,
"no-func-assign": 2,
"no-import-assign": 2,
"no-invalid-regexp": 2,
"no-invalid-this": 2,
"no-implicit-coercion": [2, {
string: false
}],
"no-implied-eval": 2,
"no-loss-of-precision": 2,
"no-multi-assign": 2,
"no-negated-condition": 2,
"no-new-native-nonconstructor": 2,
"no-new-object": 2,
"no-obj-calls": 2,
"no-self-assign": 2,
"no-unreachable": 1,
"no-unreachable-loop": 2,
"no-unsafe-finally": 2,
"no-unused-vars": 2,
"no-useless-computed-key": 2,
"no-useless-rename": 2,
"no-useless-escape": 2,
"no-unused-expressions": 2,
"no-useless-return": 2,
"no-useless-call": 2,
"no-use-before-define": [2, {
functions: false
}],
"no-useless-concat": 2,
"no-useless-backreference": 2,
"no-useless-catch": 2,
"no-unneeded-ternary": 2,
"no-undef": [2, {
typeof: true
}],
"no-undef-init": 2,
"no-useless-constructor": 2,
"no-redeclare": 2,
"no-shadow-restricted-names": 2,
"no-empty-static-block": 2,
"no-throw-literal": 2,
"no-template-curly-in-string": 2,
"no-unsafe-optional-chaining": 2,
"no-unmodified-loop-condition": 2,
"no-promise-executor-return": 2,
"no-warning-comments": 2,
"no-var": 2,
"no-new-func": 2,
"no-new-wrappers": 2,
"no-multi-str": 2,
"no-shadow": [2, {
builtinGlobals: false
}],
"no-self-compare": 2,
"no-regex-spaces": 2,
"no-constant-binary-expression": 2,
"no-sequences": 2,
"no-irregular-whitespace": [2, {
skipRegExps: true
}],
"no-constant-condition": 2,
"no-unsafe-negation": 2,
"no-undefined": 2,
"no-lone-blocks": 2,
"object-shorthand": 2,
"prefer-arrow-callback": 2,
"prefer-const": 2,
"use-isnan": 2,
"valid-typeof": 2,
yoda: 2,
"@stylistic/js/array-bracket-spacing": 2,
"@stylistic/js/arrow-parens": [2, "as-needed"],
"@stylistic/js/arrow-spacing": 2,
"@stylistic/js/block-spacing": [2, "never"],
"@stylistic/js/brace-style": 2,
"@stylistic/js/comma-dangle": 2,
"@stylistic/js/comma-style": 2,
"@stylistic/js/computed-property-spacing": 2,
"@stylistic/js/dot-location": [2, "property"],
"@stylistic/js/function-call-spacing": 2,
"@stylistic/js/generator-star-spacing": 2,
"@stylistic/js/key-spacing": 2,
"@stylistic/js/keyword-spacing": 2,
"@stylistic/js/new-parens": 2,
"@stylistic/js/no-mixed-operators": [2, {
groups: [["*", "/"], ["+", "-"]]
}],
"@stylistic/js/no-extra-semi": 2,
"@stylistic/js/no-multi-spaces": 2,
"@stylistic/js/no-mixed-spaces-and-tabs": 2,
"@stylistic/js/no-floating-decimal": 2,
"@stylistic/js/no-multiple-empty-lines": 2,
"@stylistic/js/no-whitespace-before-property": 2,
"@stylistic/js/no-trailing-spaces": 2,
"@stylistic/js/max-statements-per-line": 2,
"@stylistic/js/max-len": [2, {
code: 200
}],
"@stylistic/js/quote-props": [2, "as-needed"],
"@stylistic/js/quotes": [2, "double", {
allowTemplateLiterals: false,
avoidEscape: false
}],
"@stylistic/js/padded-blocks": [2, "never"],
"@stylistic/js/rest-spread-spacing": 2,
"@stylistic/js/semi": [2, "never"],
"@stylistic/js/space-before-blocks": 2,
"@stylistic/js/space-before-function-paren": [2, {
named: "never",
anonymous: "never",
asyncArrow: "always"
}],
"@stylistic/js/space-in-parens": 2,
"@stylistic/js/space-infix-ops": 2,
"@stylistic/js/space-unary-ops": 2,
"@stylistic/js/yield-star-spacing": 2,
"unicorn/empty-brace-spaces": 2,
"unicorn/error-message": 2,
"unicorn/new-for-builtins": 2,
"unicorn/catch-error-name": [2, {
name: "e",
ignore: [
"err",
"error",
/^\w+Error$/
]
}],
"unicorn/consistent-empty-array-spread": 2,
"unicorn/consistent-destructuring": 2,
"unicorn/consistent-function-scoping": 2,
"unicorn/no-array-method-this-argument": 2,
"unicorn/no-lonely-if": 2,
"unicorn/no-invalid-fetch-options": 2,
"unicorn/no-instanceof-array": 2,
"unicorn/no-magic-array-flat-depth": 2,
"unicorn/no-nested-ternary": 2,
"unicorn/no-new-buffer": 2,
"unicorn/no-console-spaces": 2,
"unicorn/no-for-loop": 2,
"unicorn/no-useless-undefined": 2,
"unicorn/no-unreadable-iife": 2,
"unicorn/no-unnecessary-await": 2,
"unicorn/no-unreadable-array-destructuring": 2,
"unicorn/no-useless-switch-case": 2,
"unicorn/no-typeof-undefined": 2,
"unicorn/no-useless-fallback-in-spread": 2,
"unicorn/no-useless-length-check": 2,
"unicorn/no-useless-spread": 2,
"unicorn/no-useless-promise-resolve-reject": 2,
"unicorn/no-zero-fractions": 2,
"unicorn/prefer-array-find": 2,
"unicorn/prefer-array-index-of": 2,
"unicorn/prefer-includes": 2,
"unicorn/prefer-logical-operator-over-ternary": 2,
"unicorn/prefer-date-now": 2,
"unicorn/prefer-default-parameters": 2,
"unicorn/prefer-array-some": 2,
"unicorn/prefer-blob-reading-methods": 2,
"unicorn/prefer-at": 2,
"unicorn/prefer-optional-catch-binding": 2,
"unicorn/prefer-regexp-test": 2,
"unicorn/prefer-set-has": 2,
"unicorn/prefer-set-size": 2,
"unicorn/prefer-keyboard-event-key": 2,
"unicorn/prefer-negative-index": 2,
"unicorn/prefer-node-protocol": 2,
"unicorn/prefer-number-properties": [1, {
checkInfinity: true
}],
"unicorn/prefer-prototype-methods": 2,
"unicorn/prefer-string-trim-start-end": 2,
"unicorn/prefer-string-starts-ends-with": 2,
"unicorn/prefer-structured-clone": 2,
"unicorn/throw-new-error": 2,
"unicorn/require-number-to-fixed-digits-argument": 2,
"unicorn/switch-case-braces": [2, "avoid"],
"unicorn/text-encoding-identifier-case": 2,
"unicorn/no-await-in-promise-methods": 2,
"unicorn/no-single-promise-in-promise-methods": 2,
"unicorn/no-negation-in-equality-check": 2,
"sonarjs/no-extra-arguments": 2,
"sonarjs/no-empty-collection": 2,
"sonarjs/no-element-overwrite": 2,
"sonarjs/no-use-of-empty-return-value": 2,
"sonarjs/no-all-duplicated-branches": 2,
"sonarjs/no-ignored-return": 2,
"sonarjs/no-identical-expressions": 2,
"sonarjs/no-one-iteration-loop": 2,
"sonarjs/non-existent-operator": 2,
"sonarjs/no-redundant-boolean": 2,
"sonarjs/no-unused-collection": 2,
"sonarjs/prefer-immediate-return": 2,
"sonarjs/no-inverted-boolean-check": 2,
"sonarjs/no-redundant-jump": 2,
"sonarjs/no-same-line-conditional": 2,
"sonarjs/prefer-object-literal": 2,
"sonarjs/no-collection-size-mischeck": 2,
"sonarjs/prefer-while": 2,
"sonarjs/no-gratuitous-expressions": 2,
"sonarjs/no-duplicated-branches": 2
}
}
]