@spscommerce/eslint-config-typescript 9.0.0 → 9.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/GUIDE.md +384 -5
- package/lib/rules/bestPractices.d.ts +2 -2
- package/lib/rules/bestPractices.js.map +1 -1
- package/lib/rules/es6.d.ts +2 -2
- package/lib/rules/es6.js.map +1 -1
- package/lib/rules/possibleErrors.d.ts +2 -2
- package/lib/rules/possibleErrors.js.map +1 -1
- package/lib/rules/strictMode.d.ts +2 -2
- package/lib/rules/strictMode.js.map +1 -1
- package/lib/rules/stylisticIssues.js.map +1 -1
- package/lib/rules/variables.d.ts +2 -2
- package/lib/rules/variables.js.map +1 -1
- package/lib-esm/flat.d.ts +19 -0
- package/lib-esm/flat.mjs +2336 -0
- package/lib-esm/rules/bestPractices.d.ts +2 -0
- package/lib-esm/rules/es6.d.ts +2 -0
- package/lib-esm/rules/imports/helpfulWarnings.d.ts +2 -0
- package/lib-esm/rules/imports/index.d.ts +4 -0
- package/lib-esm/rules/imports/moduleSystems.d.ts +2 -0
- package/lib-esm/rules/imports/staticAnalysis.d.ts +2 -0
- package/lib-esm/rules/imports/styleGuide.d.ts +2 -0
- package/lib-esm/rules/possibleErrors.d.ts +2 -0
- package/lib-esm/rules/strictMode.d.ts +2 -0
- package/lib-esm/rules/stylisticIssues.d.ts +2 -0
- package/lib-esm/rules/typescript.d.ts +2 -0
- package/lib-esm/rules/variables.d.ts +2 -0
- package/package.json +27 -8
- package/tsconfig.json +0 -15
package/lib-esm/flat.mjs
ADDED
|
@@ -0,0 +1,2336 @@
|
|
|
1
|
+
import { plugin as r, parser as e } from "typescript-eslint";
|
|
2
|
+
import o from "eslint-plugin-import";
|
|
3
|
+
import t from "@stylistic/eslint-plugin";
|
|
4
|
+
const s = {
|
|
5
|
+
/**
|
|
6
|
+
* enforce “for” loop update clause moving the counter in the right direction ✅
|
|
7
|
+
* https://eslint.org/docs/rules/for-direction
|
|
8
|
+
*/
|
|
9
|
+
"for-direction": "error",
|
|
10
|
+
/**
|
|
11
|
+
* enforce `return` statements in getters ✅
|
|
12
|
+
* https://eslint.org/docs/rules/getter-return
|
|
13
|
+
* Off because getters and setters are forbidden
|
|
14
|
+
*/
|
|
15
|
+
"getter-return": "off",
|
|
16
|
+
/**
|
|
17
|
+
* disallow using an async function as a Promise executor ✅
|
|
18
|
+
* https://eslint.org/docs/rules/no-async-promise-executor
|
|
19
|
+
*/
|
|
20
|
+
"no-async-promise-executor": "error",
|
|
21
|
+
/**
|
|
22
|
+
* disallow await inside of loops
|
|
23
|
+
* https://eslint.org/docs/rules/no-await-in-loop
|
|
24
|
+
*/
|
|
25
|
+
"no-await-in-loop": "error",
|
|
26
|
+
/**
|
|
27
|
+
* disallow comparisons to negative zero ✅
|
|
28
|
+
* https://eslint.org/docs/rules/no-compare-neg-zero
|
|
29
|
+
*/
|
|
30
|
+
"no-compare-neg-zero": "error",
|
|
31
|
+
/**
|
|
32
|
+
* disallow assignment in conditional expressions ✅
|
|
33
|
+
* https://eslint.org/docs/rules/no-cond-assign
|
|
34
|
+
* 'always' bans all such assignments rather than just "ambiguous" ones
|
|
35
|
+
*/
|
|
36
|
+
"no-cond-assign": ["error", "always"],
|
|
37
|
+
/**
|
|
38
|
+
* disallow use of console
|
|
39
|
+
* https://eslint.org/docs/rules/no-console
|
|
40
|
+
*/
|
|
41
|
+
"no-console": "warn",
|
|
42
|
+
/**
|
|
43
|
+
* disallow use of constant expressions in conditions ✅
|
|
44
|
+
* https://eslint.org/docs/rules/no-constant-condition
|
|
45
|
+
*/
|
|
46
|
+
"no-constant-condition": "warn",
|
|
47
|
+
/**
|
|
48
|
+
* disallow control characters in regular expressions ✅
|
|
49
|
+
* https://eslint.org/docs/rules/no-control-regex
|
|
50
|
+
*/
|
|
51
|
+
"no-control-regex": "error",
|
|
52
|
+
/**
|
|
53
|
+
* disallow use of debugger ✅
|
|
54
|
+
* https://eslint.org/docs/rules/no-debugger
|
|
55
|
+
*/
|
|
56
|
+
"no-debugger": "error",
|
|
57
|
+
/**
|
|
58
|
+
* disallow duplicate arguments in functions ✅
|
|
59
|
+
* https://eslint.org/docs/rules/no-dupe-args
|
|
60
|
+
*/
|
|
61
|
+
"no-dupe-args": "error",
|
|
62
|
+
/**
|
|
63
|
+
* Disallow duplicate conditions in if-else-if chains ✅
|
|
64
|
+
* https://eslint.org/docs/rules/no-dupe-else-if
|
|
65
|
+
*/
|
|
66
|
+
"no-dupe-else-if": "error",
|
|
67
|
+
/**
|
|
68
|
+
* disallow duplicate keys when creating object literals ✅
|
|
69
|
+
* https://eslint.org/docs/rules/no-dupe-keys
|
|
70
|
+
*/
|
|
71
|
+
"no-dupe-keys": "error",
|
|
72
|
+
/**
|
|
73
|
+
* disallow a duplicate case label ✅
|
|
74
|
+
* https://eslint.org/docs/rules/no-duplicate-case
|
|
75
|
+
*/
|
|
76
|
+
"no-duplicate-case": "error",
|
|
77
|
+
/**
|
|
78
|
+
* disallow empty statements ✅
|
|
79
|
+
* https://eslint.org/docs/rules/no-empty
|
|
80
|
+
*/
|
|
81
|
+
"no-empty": "error",
|
|
82
|
+
/**
|
|
83
|
+
* disallow the use of empty character classes in regular expressions ✅
|
|
84
|
+
* https://eslint.org/docs/rules/no-empty-character-class
|
|
85
|
+
*/
|
|
86
|
+
"no-empty-character-class": "error",
|
|
87
|
+
/**
|
|
88
|
+
* disallow assigning to the exception in a catch block ✅
|
|
89
|
+
* https://eslint.org/docs/rules/no-ex-assign
|
|
90
|
+
*/
|
|
91
|
+
"no-ex-assign": "error",
|
|
92
|
+
/**
|
|
93
|
+
* disallow double-negation boolean casts in a boolean context ✅ 🔧
|
|
94
|
+
* https://eslint.org/docs/rules/no-extra-boolean-cast
|
|
95
|
+
* Disabled because it conflicts with @typescript-eslint/strict-boolean-expressions
|
|
96
|
+
*/
|
|
97
|
+
"no-extra-boolean-cast": "off",
|
|
98
|
+
/**
|
|
99
|
+
* disallow unnecessary parentheses 🔧
|
|
100
|
+
* https://eslint.org/docs/rules/no-extra-parens
|
|
101
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-extra-parens.md
|
|
102
|
+
*/
|
|
103
|
+
"no-extra-parens": "off",
|
|
104
|
+
"@typescript-eslint/no-extra-parens": "off",
|
|
105
|
+
/**
|
|
106
|
+
* disallow unnecessary semicolons ✅ 🔧
|
|
107
|
+
* https://eslint.org/docs/rules/no-extra-semi
|
|
108
|
+
*/
|
|
109
|
+
"no-extra-semi": "error",
|
|
110
|
+
/**
|
|
111
|
+
* disallow overwriting functions written as function declarations ✅
|
|
112
|
+
* https://eslint.org/docs/rules/no-func-assign
|
|
113
|
+
*/
|
|
114
|
+
"no-func-assign": "error",
|
|
115
|
+
/**
|
|
116
|
+
* disallow assigning to imported bindings ✅
|
|
117
|
+
* https://eslint.org/docs/rules/no-import-assign
|
|
118
|
+
*/
|
|
119
|
+
"no-import-assign": "error",
|
|
120
|
+
/**
|
|
121
|
+
* disallow function or variable declarations in nested blocks ✅
|
|
122
|
+
* https://eslint.org/docs/rules/no-inner-declarations
|
|
123
|
+
*/
|
|
124
|
+
"no-inner-declarations": "error",
|
|
125
|
+
/**
|
|
126
|
+
* disallow invalid regular expression strings in the RegExp constructor ✅
|
|
127
|
+
* https://eslint.org/docs/rules/no-invalid-regexp
|
|
128
|
+
*/
|
|
129
|
+
"no-invalid-regexp": "error",
|
|
130
|
+
/**
|
|
131
|
+
* disallow irregular whitespace outside of strings and comments ✅
|
|
132
|
+
* https://eslint.org/docs/rules/no-irregular-whitespace
|
|
133
|
+
*/
|
|
134
|
+
"no-irregular-whitespace": "error",
|
|
135
|
+
/**
|
|
136
|
+
* disallow literal numbers that lose precision ✅
|
|
137
|
+
* https://eslint.org/docs/rules/no-loss-of-precision
|
|
138
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-loss-of-precision.md
|
|
139
|
+
*/
|
|
140
|
+
"no-loss-of-precision": "off",
|
|
141
|
+
"@typescript-eslint/no-loss-of-precision": "error",
|
|
142
|
+
/**
|
|
143
|
+
* disallow characters which are made with multiple code points in character class syntax ✅
|
|
144
|
+
* https://eslint.org/docs/rules/no-misleading-character-class
|
|
145
|
+
*/
|
|
146
|
+
"no-misleading-character-class": "error",
|
|
147
|
+
/**
|
|
148
|
+
* disallow the use of object properties of the global object (Math and JSON) as functions ✅
|
|
149
|
+
* https://eslint.org/docs/rules/no-obj-calls
|
|
150
|
+
*/
|
|
151
|
+
"no-obj-calls": "error",
|
|
152
|
+
/**
|
|
153
|
+
* disallow returning values from Promise executor functions
|
|
154
|
+
* https://eslint.org/docs/rules/no-promise-executor-return
|
|
155
|
+
*/
|
|
156
|
+
"no-promise-executor-return": "error",
|
|
157
|
+
/**
|
|
158
|
+
* disallow use of Object.prototypes builtins directly ✅
|
|
159
|
+
* https://eslint.org/docs/rules/no-prototype-builtins
|
|
160
|
+
*/
|
|
161
|
+
"no-prototype-builtins": "off",
|
|
162
|
+
/**
|
|
163
|
+
* disallow multiple spaces in a regular expression literal ✅ 🔧
|
|
164
|
+
* https://eslint.org/docs/rules/no-regex-spaces
|
|
165
|
+
*/
|
|
166
|
+
"no-regex-spaces": "error",
|
|
167
|
+
/**
|
|
168
|
+
* disallow returning values from setters ✅
|
|
169
|
+
* https://eslint.org/docs/rules/no-setter-return
|
|
170
|
+
* Off because getters and setters are forbidden
|
|
171
|
+
*/
|
|
172
|
+
"no-setter-return": "off",
|
|
173
|
+
/**
|
|
174
|
+
* disallow sparse arrays ✅
|
|
175
|
+
* https://eslint.org/docs/rules/no-sparse-arrays
|
|
176
|
+
* only forbids sparse array literals, not `new Array(n)`
|
|
177
|
+
*/
|
|
178
|
+
"no-sparse-arrays": "error",
|
|
179
|
+
/**
|
|
180
|
+
* disallow template literal placeholder syntax in regular strings
|
|
181
|
+
* https://eslint.org/docs/rules/no-template-curly-in-string
|
|
182
|
+
*/
|
|
183
|
+
"no-template-curly-in-string": "error",
|
|
184
|
+
/**
|
|
185
|
+
* avoid code that looks like two expressions but is actually one ✅
|
|
186
|
+
* https://eslint.org/docs/rules/no-unexpected-multiline
|
|
187
|
+
*/
|
|
188
|
+
"no-unexpected-multiline": "error",
|
|
189
|
+
/**
|
|
190
|
+
* disallow unreachable statements after a return, throw, continue, or break statement ✅
|
|
191
|
+
* https://eslint.org/docs/rules/no-unreachable
|
|
192
|
+
*/
|
|
193
|
+
"no-unreachable": "error",
|
|
194
|
+
/**
|
|
195
|
+
* disallow loops with a body that allows only one iteration
|
|
196
|
+
* https://eslint.org/docs/rules/no-unreachable-loop
|
|
197
|
+
*/
|
|
198
|
+
"no-unreachable-loop": "error",
|
|
199
|
+
/**
|
|
200
|
+
* disallow return/throw/break/continue inside finally blocks ✅
|
|
201
|
+
* https://eslint.org/docs/rules/no-unsafe-finally
|
|
202
|
+
*/
|
|
203
|
+
"no-unsafe-finally": "error",
|
|
204
|
+
/**
|
|
205
|
+
* disallow negating the left operand of relational operators ✅
|
|
206
|
+
* https://eslint.org/docs/rules/no-unsafe-negation
|
|
207
|
+
*/
|
|
208
|
+
"no-unsafe-negation": "error",
|
|
209
|
+
/**
|
|
210
|
+
* disallow use of optional chaining in contexts where the undefined value is not allowed ✅
|
|
211
|
+
* https://eslint.org/docs/rules/no-unsafe-optional-chaining
|
|
212
|
+
*/
|
|
213
|
+
"no-unsafe-optional-chaining": "error",
|
|
214
|
+
/**
|
|
215
|
+
* Disallow useless backreferences in regular expressions ✅
|
|
216
|
+
* https://eslint.org/docs/rules/no-useless-backreference
|
|
217
|
+
*/
|
|
218
|
+
"no-useless-backreference": "off",
|
|
219
|
+
/**
|
|
220
|
+
* Disallow assignments that can lead to race conditions due to usage of await or yield
|
|
221
|
+
* https://eslint.org/docs/rules/require-atomic-updates
|
|
222
|
+
*/
|
|
223
|
+
"require-atomic-updates": "error",
|
|
224
|
+
/**
|
|
225
|
+
* disallow comparisons with the value NaN ✅
|
|
226
|
+
* https://eslint.org/docs/rules/use-isnan
|
|
227
|
+
*/
|
|
228
|
+
"use-isnan": "error",
|
|
229
|
+
/**
|
|
230
|
+
* ensure that the results of typeof are compared against a valid string ✅
|
|
231
|
+
* https://eslint.org/docs/rules/valid-typeof
|
|
232
|
+
*/
|
|
233
|
+
"valid-typeof": ["error", { requireStringLiterals: !0 }]
|
|
234
|
+
}, n = {
|
|
235
|
+
/**
|
|
236
|
+
* enforces getter/setter pairs in objects
|
|
237
|
+
* https://eslint.org/docs/rules/accessor-pairs
|
|
238
|
+
* Off because getters and setters are forbidden
|
|
239
|
+
*/
|
|
240
|
+
"accessor-pairs": "off",
|
|
241
|
+
/**
|
|
242
|
+
* enforces return statements in callbacks of array's methods
|
|
243
|
+
* https://eslint.org/docs/rules/array-callback-return
|
|
244
|
+
*/
|
|
245
|
+
"array-callback-return": ["error", { allowImplicit: !0 }],
|
|
246
|
+
/**
|
|
247
|
+
* treat var statements as if they were block scoped
|
|
248
|
+
* https://eslint.org/docs/rules/block-scoped-var
|
|
249
|
+
* Off because `var` is forbidden
|
|
250
|
+
*/
|
|
251
|
+
"block-scoped-var": "off",
|
|
252
|
+
/**
|
|
253
|
+
* specify the maximum cyclomatic complexity allowed in a program
|
|
254
|
+
* https://eslint.org/docs/rules/complexity
|
|
255
|
+
*/
|
|
256
|
+
complexity: "off",
|
|
257
|
+
/**
|
|
258
|
+
* enforce that class methods use "this"
|
|
259
|
+
* https://eslint.org/docs/rules/class-methods-use-this
|
|
260
|
+
*/
|
|
261
|
+
"class-methods-use-this": "error",
|
|
262
|
+
/**
|
|
263
|
+
* require return statements to either always or never specify values
|
|
264
|
+
* https://eslint.org/docs/rules/consistent-return
|
|
265
|
+
*/
|
|
266
|
+
"consistent-return": "off",
|
|
267
|
+
/**
|
|
268
|
+
* specify curly brace conventions for all control statements 🔧
|
|
269
|
+
* https://eslint.org/docs/rules/curly
|
|
270
|
+
*/
|
|
271
|
+
curly: ["error", "multi-line"],
|
|
272
|
+
/**
|
|
273
|
+
* require default case in switch statements
|
|
274
|
+
* https://eslint.org/docs/rules/default-case
|
|
275
|
+
*/
|
|
276
|
+
"default-case": ["error", { commentPattern: "^no default$" }],
|
|
277
|
+
/**
|
|
278
|
+
* Enforce default clauses in switch statements to be last
|
|
279
|
+
* https://eslint.org/docs/rules/default-case-last
|
|
280
|
+
*/
|
|
281
|
+
"default-case-last": "error",
|
|
282
|
+
/**
|
|
283
|
+
* enforce default parameters to be last
|
|
284
|
+
* https://eslint.org/docs/rules/default-param-last
|
|
285
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/default-param-last.md
|
|
286
|
+
*/
|
|
287
|
+
"default-param-last": "off",
|
|
288
|
+
"@typescript-eslint/default-param-last": "error",
|
|
289
|
+
/**
|
|
290
|
+
* enforces consistent newlines before or after dots
|
|
291
|
+
* https://eslint.org/docs/rules/dot-location
|
|
292
|
+
*/
|
|
293
|
+
"dot-location": ["error", "property"],
|
|
294
|
+
/**
|
|
295
|
+
* encourages use of dot notation whenever possible 🔧
|
|
296
|
+
* https://eslint.org/docs/rules/dot-notation
|
|
297
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/dot-notation.md
|
|
298
|
+
*/
|
|
299
|
+
"dot-notation": "off",
|
|
300
|
+
"@typescript-eslint/dot-notation": ["error", { allowKeywords: !0 }],
|
|
301
|
+
/**
|
|
302
|
+
* require the use of === and !== 🔧
|
|
303
|
+
* https://eslint.org/docs/rules/eqeqeq
|
|
304
|
+
*/
|
|
305
|
+
eqeqeq: [
|
|
306
|
+
"error",
|
|
307
|
+
"always",
|
|
308
|
+
{ null: "ignore" }
|
|
309
|
+
],
|
|
310
|
+
/**
|
|
311
|
+
* Require grouped accessor pairs in object literals and classes
|
|
312
|
+
* https://eslint.org/docs/rules/grouped-accessor-pairs
|
|
313
|
+
* Off because getters and setters are forbidden
|
|
314
|
+
*/
|
|
315
|
+
"grouped-accessor-pairs": "off",
|
|
316
|
+
/**
|
|
317
|
+
* make sure for-in loops have an if statement
|
|
318
|
+
* https://eslint.org/docs/rules/guard-for-in
|
|
319
|
+
* Off because for-in is forbidden
|
|
320
|
+
*/
|
|
321
|
+
"guard-for-in": "off",
|
|
322
|
+
/**
|
|
323
|
+
* enforce a maximum number of classes per file
|
|
324
|
+
* https://eslint.org/docs/rules/max-classes-per-file
|
|
325
|
+
*/
|
|
326
|
+
"max-classes-per-file": ["error", 1],
|
|
327
|
+
/**
|
|
328
|
+
* disallow the use of alert, confirm, and prompt
|
|
329
|
+
* https://eslint.org/docs/rules/no-alert
|
|
330
|
+
*/
|
|
331
|
+
"no-alert": "error",
|
|
332
|
+
/**
|
|
333
|
+
* disallow use of arguments.caller or arguments.callee
|
|
334
|
+
* https://eslint.org/docs/rules/no-caller
|
|
335
|
+
*/
|
|
336
|
+
"no-caller": "error",
|
|
337
|
+
/**
|
|
338
|
+
* disallow lexical declarations in case/default clauses ✅
|
|
339
|
+
* https://eslint.org/docs/rules/no-case-declarations
|
|
340
|
+
*/
|
|
341
|
+
"no-case-declarations": "error",
|
|
342
|
+
/**
|
|
343
|
+
* Disallow returning value in constructor
|
|
344
|
+
* https://eslint.org/docs/rules/no-constructor-return
|
|
345
|
+
*/
|
|
346
|
+
"no-constructor-return": "error",
|
|
347
|
+
/**
|
|
348
|
+
* disallow division operators explicitly at beginning of regular expression 🔧
|
|
349
|
+
* https://eslint.org/docs/rules/no-div-regex
|
|
350
|
+
*/
|
|
351
|
+
"no-div-regex": "off",
|
|
352
|
+
/**
|
|
353
|
+
* disallow else after a return in an if 🔧
|
|
354
|
+
* https://eslint.org/docs/rules/no-else-return
|
|
355
|
+
*/
|
|
356
|
+
"no-else-return": "off",
|
|
357
|
+
/**
|
|
358
|
+
* disallow empty functions
|
|
359
|
+
* https://eslint.org/docs/rules/no-empty-function
|
|
360
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-empty-function.md
|
|
361
|
+
*/
|
|
362
|
+
"no-empty-function": "off",
|
|
363
|
+
"@typescript-eslint/no-empty-function": "off",
|
|
364
|
+
/**
|
|
365
|
+
* disallow empty destructuring patterns ✅
|
|
366
|
+
* https://eslint.org/docs/rules/no-empty-pattern
|
|
367
|
+
*/
|
|
368
|
+
"no-empty-pattern": "error",
|
|
369
|
+
/**
|
|
370
|
+
* disallow comparisons to null without a type-checking operator
|
|
371
|
+
* https://eslint.org/docs/rules/no-eq-null
|
|
372
|
+
* Off because it's superceded by eqeqeq
|
|
373
|
+
*/
|
|
374
|
+
"no-eq-null": "off",
|
|
375
|
+
/**
|
|
376
|
+
* disallow use of eval()
|
|
377
|
+
* https://eslint.org/docs/rules/no-eval
|
|
378
|
+
*/
|
|
379
|
+
"no-eval": "error",
|
|
380
|
+
/**
|
|
381
|
+
* disallow adding to native types
|
|
382
|
+
* https://eslint.org/docs/rules/no-extend-native
|
|
383
|
+
*/
|
|
384
|
+
"no-extend-native": "error",
|
|
385
|
+
/**
|
|
386
|
+
* disallow unnecessary function binding 🔧
|
|
387
|
+
* https://eslint.org/docs/rules/no-extra-bind
|
|
388
|
+
*/
|
|
389
|
+
"no-extra-bind": "error",
|
|
390
|
+
/**
|
|
391
|
+
* disallow Unnecessary Labels 🔧
|
|
392
|
+
* https://eslint.org/docs/rules/no-extra-label
|
|
393
|
+
*/
|
|
394
|
+
"no-extra-label": "error",
|
|
395
|
+
/**
|
|
396
|
+
* disallow fallthrough of case statements ✅
|
|
397
|
+
* https://eslint.org/docs/rules/no-fallthrough
|
|
398
|
+
*/
|
|
399
|
+
"no-fallthrough": "error",
|
|
400
|
+
/**
|
|
401
|
+
* disallow the use of leading or trailing decimal points in numeric literals 🔧
|
|
402
|
+
* https://eslint.org/docs/rules/no-floating-decimal
|
|
403
|
+
*/
|
|
404
|
+
"no-floating-decimal": "error",
|
|
405
|
+
/**
|
|
406
|
+
* disallow reassignments of native objects or read-only globals ✅
|
|
407
|
+
* https://eslint.org/docs/rules/no-global-assign
|
|
408
|
+
*/
|
|
409
|
+
"no-global-assign": "error",
|
|
410
|
+
/**
|
|
411
|
+
* disallow implicit type conversions 🔧
|
|
412
|
+
* https://eslint.org/docs/rules/no-implicit-coercion
|
|
413
|
+
*/
|
|
414
|
+
"no-implicit-coercion": [
|
|
415
|
+
"error",
|
|
416
|
+
{
|
|
417
|
+
boolean: !1,
|
|
418
|
+
number: !0,
|
|
419
|
+
string: !0
|
|
420
|
+
}
|
|
421
|
+
],
|
|
422
|
+
/**
|
|
423
|
+
* disallow var and named functions in global scope
|
|
424
|
+
* https://eslint.org/docs/rules/no-implicit-globals
|
|
425
|
+
* disabled because it can't distinguish between a file with no imports and a browser script
|
|
426
|
+
*/
|
|
427
|
+
"no-implicit-globals": "off",
|
|
428
|
+
/**
|
|
429
|
+
* disallow use of eval()-like methods
|
|
430
|
+
* https://eslint.org/docs/rules/no-implied-eval
|
|
431
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-implied-eval.md
|
|
432
|
+
*/
|
|
433
|
+
"no-implied-eval": "off",
|
|
434
|
+
"@typescript-eslint/no-implied-eval": "error",
|
|
435
|
+
/**
|
|
436
|
+
* disallow assignment to imported bindings
|
|
437
|
+
* https://eslint.org/docs/rules/no-import-assign
|
|
438
|
+
*/
|
|
439
|
+
"no-import-assign": "error",
|
|
440
|
+
/**
|
|
441
|
+
* disallow this keywords outside of classes or class-like objects
|
|
442
|
+
* https://eslint.org/docs/rules/no-invalid-this
|
|
443
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-invalid-this.md
|
|
444
|
+
*/
|
|
445
|
+
"no-invalid-this": "off",
|
|
446
|
+
"@typescript-eslint/no-invalid-this": "off",
|
|
447
|
+
/**
|
|
448
|
+
* disallow usage of __iterator__ property
|
|
449
|
+
* https://eslint.org/docs/rules/no-iterator
|
|
450
|
+
*/
|
|
451
|
+
"no-iterator": "error",
|
|
452
|
+
/**
|
|
453
|
+
* disallow use of labels for anything other than loops and switches
|
|
454
|
+
* https://eslint.org/docs/rules/no-labels
|
|
455
|
+
*/
|
|
456
|
+
"no-labels": "error",
|
|
457
|
+
/**
|
|
458
|
+
* disallow unnecessary nested blocks
|
|
459
|
+
* https://eslint.org/docs/rules/no-lone-blocks
|
|
460
|
+
*/
|
|
461
|
+
"no-lone-blocks": "error",
|
|
462
|
+
/**
|
|
463
|
+
* disallow creation of functions within loops
|
|
464
|
+
* https://eslint.org/docs/rules/no-loop-func
|
|
465
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-loop-func.md
|
|
466
|
+
*/
|
|
467
|
+
"no-loop-func": "off",
|
|
468
|
+
"@typescript-eslint/no-loop-func": "error",
|
|
469
|
+
/**
|
|
470
|
+
* disallow magic numbers
|
|
471
|
+
* https://eslint.org/docs/rules/no-magic-numbers
|
|
472
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-magic-numbers.md
|
|
473
|
+
*/
|
|
474
|
+
"no-magic-numbers": "off",
|
|
475
|
+
"@typescript-eslint/no-magic-numbers": [
|
|
476
|
+
"error",
|
|
477
|
+
{
|
|
478
|
+
ignore: [
|
|
479
|
+
-1,
|
|
480
|
+
0,
|
|
481
|
+
1,
|
|
482
|
+
2
|
|
483
|
+
],
|
|
484
|
+
ignoreArrayIndexes: !0
|
|
485
|
+
}
|
|
486
|
+
],
|
|
487
|
+
/**
|
|
488
|
+
* disallow use of multiple spaces 🔧
|
|
489
|
+
* https://eslint.org/docs/rules/no-multi-spaces
|
|
490
|
+
*/
|
|
491
|
+
"no-multi-spaces": "error",
|
|
492
|
+
/**
|
|
493
|
+
* disallow use of multiline strings
|
|
494
|
+
* https://eslint.org/docs/rules/no-multi-str
|
|
495
|
+
*/
|
|
496
|
+
"no-multi-str": "error",
|
|
497
|
+
/**
|
|
498
|
+
* disallow use of new operator when not part of the assignment or comparison
|
|
499
|
+
* https://eslint.org/docs/rules/no-new
|
|
500
|
+
*/
|
|
501
|
+
"no-new": "error",
|
|
502
|
+
/**
|
|
503
|
+
* disallow use of new operator for Function object
|
|
504
|
+
* https://eslint.org/docs/rules/no-new-func
|
|
505
|
+
*/
|
|
506
|
+
"no-new-func": "error",
|
|
507
|
+
/**
|
|
508
|
+
* disallows creating new instances of String, Number, and Boolean
|
|
509
|
+
* https://eslint.org/docs/rules/no-new-wrappers
|
|
510
|
+
*/
|
|
511
|
+
"no-new-wrappers": "error",
|
|
512
|
+
/**
|
|
513
|
+
* Disallow \8 and \9 escape sequences in string literals ✅
|
|
514
|
+
* https://eslint.org/docs/rules/no-nonoctal-decimal-escape
|
|
515
|
+
*/
|
|
516
|
+
"no-nonoctal-decimal-escape": "error",
|
|
517
|
+
/**
|
|
518
|
+
* disallow use of (old style) octal literals ✅
|
|
519
|
+
* https://eslint.org/docs/rules/no-octal
|
|
520
|
+
*/
|
|
521
|
+
"no-octal": "error",
|
|
522
|
+
/**
|
|
523
|
+
* disallow use of octal escape sequences in string literals, such as
|
|
524
|
+
* https://eslint.org/docs/rules/no-octal-escape
|
|
525
|
+
*/
|
|
526
|
+
"no-octal-escape": "error",
|
|
527
|
+
/**
|
|
528
|
+
* disallow reassignment of function parameters, and
|
|
529
|
+
* disallow parameter object manipulation except for specific exclusions
|
|
530
|
+
* rule: https://eslint.org/docs/rules/no-param-reassign.html
|
|
531
|
+
*/
|
|
532
|
+
"no-param-reassign": [
|
|
533
|
+
"error",
|
|
534
|
+
{
|
|
535
|
+
props: !0,
|
|
536
|
+
ignorePropertyModificationsFor: [
|
|
537
|
+
"acc",
|
|
538
|
+
"accumulator"
|
|
539
|
+
]
|
|
540
|
+
}
|
|
541
|
+
],
|
|
542
|
+
/**
|
|
543
|
+
* disallow usage of __proto__ property
|
|
544
|
+
* https://eslint.org/docs/rules/no-proto
|
|
545
|
+
*/
|
|
546
|
+
"no-proto": "error",
|
|
547
|
+
/**
|
|
548
|
+
* disallow declaring the same variable more than once ✅
|
|
549
|
+
* https://eslint.org/docs/rules/no-redeclare
|
|
550
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-redeclare.md
|
|
551
|
+
*/
|
|
552
|
+
"no-redeclare": "off",
|
|
553
|
+
"@typescript-eslint/no-redeclare": "error",
|
|
554
|
+
/**
|
|
555
|
+
* disallow certain object properties
|
|
556
|
+
* https://eslint.org/docs/rules/no-restricted-properties
|
|
557
|
+
*/
|
|
558
|
+
"no-restricted-properties": [
|
|
559
|
+
"error",
|
|
560
|
+
{
|
|
561
|
+
object: "arguments",
|
|
562
|
+
property: "callee",
|
|
563
|
+
message: "arguments.callee is deprecated"
|
|
564
|
+
},
|
|
565
|
+
{
|
|
566
|
+
object: "global",
|
|
567
|
+
property: "isFinite",
|
|
568
|
+
message: "Please use Number.isFinite instead"
|
|
569
|
+
},
|
|
570
|
+
{
|
|
571
|
+
object: "self",
|
|
572
|
+
property: "isFinite",
|
|
573
|
+
message: "Please use Number.isFinite instead"
|
|
574
|
+
},
|
|
575
|
+
{
|
|
576
|
+
object: "window",
|
|
577
|
+
property: "isFinite",
|
|
578
|
+
message: "Please use Number.isFinite instead"
|
|
579
|
+
},
|
|
580
|
+
{
|
|
581
|
+
object: "global",
|
|
582
|
+
property: "isNaN",
|
|
583
|
+
message: "Please use Number.isNaN instead"
|
|
584
|
+
},
|
|
585
|
+
{
|
|
586
|
+
object: "self",
|
|
587
|
+
property: "isNaN",
|
|
588
|
+
message: "Please use Number.isNaN instead"
|
|
589
|
+
},
|
|
590
|
+
{
|
|
591
|
+
object: "window",
|
|
592
|
+
property: "isNaN",
|
|
593
|
+
message: "Please use Number.isNaN instead"
|
|
594
|
+
},
|
|
595
|
+
{
|
|
596
|
+
property: "__defineGetter__",
|
|
597
|
+
message: "Please use Object.defineProperty instead."
|
|
598
|
+
},
|
|
599
|
+
{
|
|
600
|
+
property: "__defineSetter__",
|
|
601
|
+
message: "Please use Object.defineProperty instead."
|
|
602
|
+
}
|
|
603
|
+
],
|
|
604
|
+
/**
|
|
605
|
+
* disallow use of assignment in return statement
|
|
606
|
+
* https://eslint.org/docs/rules/no-return-assign
|
|
607
|
+
*/
|
|
608
|
+
"no-return-assign": "error",
|
|
609
|
+
/**
|
|
610
|
+
* disallow redundant `return await`
|
|
611
|
+
* https://eslint.org/docs/rules/no-return-await
|
|
612
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/return-await.md
|
|
613
|
+
*/
|
|
614
|
+
"no-return-await": "off",
|
|
615
|
+
"@typescript-eslint/return-await": "error",
|
|
616
|
+
/**
|
|
617
|
+
* disallow use of `javascript:` urls.
|
|
618
|
+
* https://eslint.org/docs/rules/no-script-url
|
|
619
|
+
*/
|
|
620
|
+
"no-script-url": "error",
|
|
621
|
+
/**
|
|
622
|
+
* disallow self assignment ✅
|
|
623
|
+
* https://eslint.org/docs/rules/no-self-assign
|
|
624
|
+
*/
|
|
625
|
+
"no-self-assign": "error",
|
|
626
|
+
/**
|
|
627
|
+
* disallow comparisons where both sides are exactly the same
|
|
628
|
+
* https://eslint.org/docs/rules/no-self-compare
|
|
629
|
+
*/
|
|
630
|
+
"no-self-compare": "error",
|
|
631
|
+
/**
|
|
632
|
+
* disallow use of comma operator
|
|
633
|
+
* https://eslint.org/docs/rules/no-sequences
|
|
634
|
+
*/
|
|
635
|
+
"no-sequences": "error",
|
|
636
|
+
/**
|
|
637
|
+
* restrict what can be thrown as an exception
|
|
638
|
+
* https://eslint.org/docs/rules/no-throw-literal
|
|
639
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/only-throw-error.mdx
|
|
640
|
+
*/
|
|
641
|
+
"no-throw-literal": "off",
|
|
642
|
+
"@typescript-eslint/only-throw-error": "error",
|
|
643
|
+
/**
|
|
644
|
+
* disallow unmodified conditions of loops
|
|
645
|
+
* https://eslint.org/docs/rules/no-unmodified-loop-condition
|
|
646
|
+
*/
|
|
647
|
+
"no-unmodified-loop-condition": "off",
|
|
648
|
+
/**
|
|
649
|
+
* disallow usage of expressions in statement position
|
|
650
|
+
* https://eslint.org/docs/rules/no-unused-expressions
|
|
651
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unused-expressions.md
|
|
652
|
+
*/
|
|
653
|
+
"no-unused-expressions": "off",
|
|
654
|
+
"@typescript-eslint/no-unused-expressions": ["error", { allowTaggedTemplates: !1 }],
|
|
655
|
+
/**
|
|
656
|
+
* disallow unused labels ✅ 🔧
|
|
657
|
+
* https://eslint.org/docs/rules/no-unused-labels
|
|
658
|
+
*/
|
|
659
|
+
"no-unused-labels": "error",
|
|
660
|
+
/**
|
|
661
|
+
* disallow useless backreferences in regular expressions
|
|
662
|
+
* https://eslint.org/docs/rules/no-useless-backreference
|
|
663
|
+
*/
|
|
664
|
+
"no-useless-backreference": "error",
|
|
665
|
+
/**
|
|
666
|
+
* disallow unnecessary .call() and .apply()
|
|
667
|
+
* https://eslint.org/docs/rules/no-useless-call
|
|
668
|
+
*/
|
|
669
|
+
"no-useless-call": "off",
|
|
670
|
+
/**
|
|
671
|
+
* Disallow unnecessary catch clauses ✅
|
|
672
|
+
* https://eslint.org/docs/rules/no-useless-catch
|
|
673
|
+
*/
|
|
674
|
+
"no-useless-catch": "error",
|
|
675
|
+
/**
|
|
676
|
+
* disallow useless string concatenation
|
|
677
|
+
* https://eslint.org/docs/rules/no-useless-concat
|
|
678
|
+
*/
|
|
679
|
+
"no-useless-concat": "error",
|
|
680
|
+
/**
|
|
681
|
+
* disallow unnecessary string escaping ✅
|
|
682
|
+
* https://eslint.org/docs/rules/no-useless-escape
|
|
683
|
+
*/
|
|
684
|
+
"no-useless-escape": "error",
|
|
685
|
+
/**
|
|
686
|
+
* disallow redundant return; keywords 🔧
|
|
687
|
+
* https://eslint.org/docs/rules/no-useless-return
|
|
688
|
+
*/
|
|
689
|
+
"no-useless-return": "error",
|
|
690
|
+
/**
|
|
691
|
+
* disallow use of void operator
|
|
692
|
+
* https://eslint.org/docs/rules/no-void
|
|
693
|
+
* Typing for this rule config seems to be incorrect
|
|
694
|
+
*/
|
|
695
|
+
"no-void": ["error", { allowAsStatement: !0 }],
|
|
696
|
+
/**
|
|
697
|
+
* disallow usage of configurable warning terms in comments: e.g. todo
|
|
698
|
+
* https://eslint.org/docs/rules/no-warning-comments
|
|
699
|
+
*/
|
|
700
|
+
"no-warning-comments": "off",
|
|
701
|
+
/**
|
|
702
|
+
* disallow use of the with statement ✅
|
|
703
|
+
* https://eslint.org/docs/rules/no-with
|
|
704
|
+
*/
|
|
705
|
+
"no-with": "error",
|
|
706
|
+
/**
|
|
707
|
+
* require `Object.hasOwn` instead of `Object.prototype.hasOwnProperty.call`
|
|
708
|
+
* https://eslint.org/docs/rules/prefer-object-has-own
|
|
709
|
+
*/
|
|
710
|
+
"prefer-object-has-own": "error",
|
|
711
|
+
/**
|
|
712
|
+
* require using Error objects as Promise rejection reasons
|
|
713
|
+
* https://eslint.org/docs/rules/prefer-promise-reject-errors
|
|
714
|
+
*/
|
|
715
|
+
"prefer-promise-reject-errors": ["error", { allowEmptyReject: !0 }],
|
|
716
|
+
/**
|
|
717
|
+
* Suggest using named capture group in regular expression
|
|
718
|
+
* https://eslint.org/docs/rules/prefer-named-capture-group
|
|
719
|
+
*/
|
|
720
|
+
"prefer-named-capture-group": "off",
|
|
721
|
+
/**
|
|
722
|
+
* disallow use of the `RegExp` constructor in favor of regular expression literals
|
|
723
|
+
* https://eslint.org/docs/rules/prefer-regex-literals
|
|
724
|
+
*/
|
|
725
|
+
"prefer-regex-literals": "error",
|
|
726
|
+
/**
|
|
727
|
+
* require use of the second argument for parseInt()
|
|
728
|
+
* https://eslint.org/docs/rules/radix
|
|
729
|
+
*/
|
|
730
|
+
radix: "error",
|
|
731
|
+
/**
|
|
732
|
+
* require `await` in `async function` (note: this is a horrible rule that should never be used)
|
|
733
|
+
* https://eslint.org/docs/rules/require-await
|
|
734
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/require-await.md
|
|
735
|
+
*/
|
|
736
|
+
"require-await": "off",
|
|
737
|
+
"@typescript-eslint/require-await": "off",
|
|
738
|
+
/**
|
|
739
|
+
* Enforce the use of u flag on RegExp
|
|
740
|
+
* https://eslint.org/docs/rules/require-unicode-regexp
|
|
741
|
+
*/
|
|
742
|
+
"require-unicode-regexp": "off",
|
|
743
|
+
/**
|
|
744
|
+
* requires to declare all vars on top of their containing scope
|
|
745
|
+
* https://eslint.org/docs/rules/vars-on-top
|
|
746
|
+
* Off because var is forbidden
|
|
747
|
+
*/
|
|
748
|
+
"vars-on-top": "off",
|
|
749
|
+
/**
|
|
750
|
+
* require immediate function invocation to be wrapped in parentheses
|
|
751
|
+
* https://eslint.org/docs/rules/wrap-iife.html
|
|
752
|
+
*/
|
|
753
|
+
"wrap-iife": [
|
|
754
|
+
"error",
|
|
755
|
+
"outside",
|
|
756
|
+
{ functionPrototypeMethods: !1 }
|
|
757
|
+
],
|
|
758
|
+
/**
|
|
759
|
+
* require or disallow Yoda conditions 🔧
|
|
760
|
+
* https://eslint.org/docs/rules/yoda
|
|
761
|
+
*/
|
|
762
|
+
yoda: "error"
|
|
763
|
+
}, i = {
|
|
764
|
+
/**
|
|
765
|
+
* disallow the 'use strict' directive 🔧
|
|
766
|
+
* https://eslint.org/docs/rules/strict
|
|
767
|
+
* this is handled for you and does not need to be present in your source files
|
|
768
|
+
*/
|
|
769
|
+
strict: ["error", "never"]
|
|
770
|
+
}, a = {
|
|
771
|
+
/**
|
|
772
|
+
* enforce or disallow variable initializations at definition
|
|
773
|
+
* https://eslint.org/docs/rules/init-declarations
|
|
774
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/init-declarations.md
|
|
775
|
+
*/
|
|
776
|
+
"init-declarations": "off",
|
|
777
|
+
"@typescript-eslint/init-declarations": "off",
|
|
778
|
+
/**
|
|
779
|
+
* disallow the catch clause parameter name being the same as a variable in the outer scope
|
|
780
|
+
* https://eslint.org/docs/rules/no-catch-shadow
|
|
781
|
+
*/
|
|
782
|
+
"no-catch-shadow": "off",
|
|
783
|
+
/**
|
|
784
|
+
* disallow deletion of variables ✅
|
|
785
|
+
* https://eslint.org/docs/rules/no-delete-var
|
|
786
|
+
*/
|
|
787
|
+
"no-delete-var": "error",
|
|
788
|
+
/**
|
|
789
|
+
* disallow labels that share a name with a variable
|
|
790
|
+
* https://eslint.org/docs/rules/no-label-var
|
|
791
|
+
*/
|
|
792
|
+
"no-label-var": "error",
|
|
793
|
+
/**
|
|
794
|
+
* disallow specific globals
|
|
795
|
+
* https://eslint.org/docs/rules/no-restricted-globals
|
|
796
|
+
*/
|
|
797
|
+
"no-restricted-globals": [
|
|
798
|
+
"error",
|
|
799
|
+
{
|
|
800
|
+
name: "isFinite",
|
|
801
|
+
message: "Use Number.isFinite instead https://github.com/airbnb/javascript#standard-library--isfinite"
|
|
802
|
+
},
|
|
803
|
+
{
|
|
804
|
+
name: "isNaN",
|
|
805
|
+
message: "Use Number.isNaN instead https://github.com/airbnb/javascript#standard-library--isnan"
|
|
806
|
+
}
|
|
807
|
+
],
|
|
808
|
+
/**
|
|
809
|
+
* disallow declaration of variables already declared in the outer scope
|
|
810
|
+
* https://eslint.org/docs/rules/no-shadow
|
|
811
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-shadow.md
|
|
812
|
+
*/
|
|
813
|
+
"no-shadow": "off",
|
|
814
|
+
"@typescript-eslint/no-shadow": "error",
|
|
815
|
+
/**
|
|
816
|
+
* disallow shadowing of names such as arguments ✅
|
|
817
|
+
* https://eslint.org/docs/rules/no-shadow-restricted-names
|
|
818
|
+
*/
|
|
819
|
+
"no-shadow-restricted-names": "error",
|
|
820
|
+
/**
|
|
821
|
+
* disallow use of undeclared variables unless mentioned in `/*global ` comments ✅
|
|
822
|
+
* https://eslint.org/docs/rules/no-undef
|
|
823
|
+
*/
|
|
824
|
+
"no-undef": "error",
|
|
825
|
+
/**
|
|
826
|
+
* disallow use of undefined when initializing variables 🔧
|
|
827
|
+
* https://eslint.org/docs/rules/no-undef-init
|
|
828
|
+
*/
|
|
829
|
+
"no-undef-init": "error",
|
|
830
|
+
/**
|
|
831
|
+
* disallow use of undefined variable
|
|
832
|
+
* https://eslint.org/docs/rules/no-undefined
|
|
833
|
+
*/
|
|
834
|
+
"no-undefined": "off",
|
|
835
|
+
/**
|
|
836
|
+
* disallow declaration of variables that are not used in the code ✅
|
|
837
|
+
* https://eslint.org/docs/rules/no-unused-vars
|
|
838
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unused-vars.md
|
|
839
|
+
*/
|
|
840
|
+
"no-unused-vars": "off",
|
|
841
|
+
"@typescript-eslint/no-unused-vars": ["error", { ignoreRestSiblings: !0 }],
|
|
842
|
+
/**
|
|
843
|
+
* disallow use of variables before they are defined
|
|
844
|
+
* https://eslint.org/docs/rules/no-use-before-define
|
|
845
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-use-before-define.md
|
|
846
|
+
*/
|
|
847
|
+
"no-use-before-define": "off",
|
|
848
|
+
"@typescript-eslint/no-use-before-define": "error"
|
|
849
|
+
}, p = {
|
|
850
|
+
/**
|
|
851
|
+
* enforce line breaks after opening and before closing array brackets 🔧
|
|
852
|
+
* https://eslint.org/docs/rules/array-bracket-newline
|
|
853
|
+
*/
|
|
854
|
+
"array-bracket-newline": ["error", "consistent"],
|
|
855
|
+
/**
|
|
856
|
+
* enforce spacing inside array brackets 🔧
|
|
857
|
+
* https://eslint.org/docs/rules/array-bracket-spacing
|
|
858
|
+
*/
|
|
859
|
+
"array-bracket-spacing": ["error", "never"],
|
|
860
|
+
/**
|
|
861
|
+
* enforce spacing inside single-line blocks 🔧
|
|
862
|
+
* https://eslint.org/docs/rules/block-spacing
|
|
863
|
+
*/
|
|
864
|
+
"block-spacing": ["error", "always"],
|
|
865
|
+
/**
|
|
866
|
+
* enforce one true brace style 🔧
|
|
867
|
+
* https://eslint.style/rules/ts/brace-style#ts-brace-style
|
|
868
|
+
*/
|
|
869
|
+
"@stylistic/brace-style": "error",
|
|
870
|
+
/**
|
|
871
|
+
* require camel case names
|
|
872
|
+
* https://eslint.org/docs/rules/camelcase
|
|
873
|
+
*/
|
|
874
|
+
camelcase: ["error", { properties: "never" }],
|
|
875
|
+
/**
|
|
876
|
+
* enforce or disallow capitalization of the first letter of a comment 🔧
|
|
877
|
+
* https://eslint.org/docs/rules/capitalized-comments
|
|
878
|
+
*/
|
|
879
|
+
"capitalized-comments": "off",
|
|
880
|
+
/**
|
|
881
|
+
* require trailing commas in multiline object literals 🔧
|
|
882
|
+
* https://eslint.style/rules/ts/comma-dangle#ts-comma-dangle
|
|
883
|
+
*/
|
|
884
|
+
"@stylistic/comma-dangle": ["error", "always-multiline"],
|
|
885
|
+
/**
|
|
886
|
+
* enforce spacing before/after comma 🔧
|
|
887
|
+
* https://eslint.style/rules/ts/comma-spacing#ts-comma-spacing
|
|
888
|
+
*/
|
|
889
|
+
"@stylistic/comma-spacing": "error",
|
|
890
|
+
/**
|
|
891
|
+
* enforce one true comma style 🔧
|
|
892
|
+
* https://eslint.org/docs/rules/comma-style
|
|
893
|
+
*/
|
|
894
|
+
"comma-style": "error",
|
|
895
|
+
/**
|
|
896
|
+
* disallow padding inside computed properties 🔧
|
|
897
|
+
* https://eslint.org/docs/rules/computed-property-spacing
|
|
898
|
+
*/
|
|
899
|
+
"computed-property-spacing": "error",
|
|
900
|
+
/**
|
|
901
|
+
* enforces consistent naming when capturing the current execution context
|
|
902
|
+
* https://eslint.org/docs/rules/consistent-this
|
|
903
|
+
* doing this at all is forbidden
|
|
904
|
+
*/
|
|
905
|
+
"consistent-this": "off",
|
|
906
|
+
/**
|
|
907
|
+
* enforce newline at the end of file, with no multiple empty lines 🔧
|
|
908
|
+
* https://eslint.org/docs/rules/eol-last
|
|
909
|
+
*/
|
|
910
|
+
"eol-last": "error",
|
|
911
|
+
/**
|
|
912
|
+
* enforce spacing between functions and their invocations 🔧
|
|
913
|
+
* https://eslint.style/packages/eslint-plugin-ts/rules/func-call-spacing/README#ts-func-call-spacing
|
|
914
|
+
*/
|
|
915
|
+
"@stylistic/function-call-spacing": "error",
|
|
916
|
+
/**
|
|
917
|
+
* requires function names to match the name of the
|
|
918
|
+
* variable or property to which they are assigned
|
|
919
|
+
* https://eslint.org/docs/rules/func-name-matching
|
|
920
|
+
*/
|
|
921
|
+
"func-name-matching": "off",
|
|
922
|
+
/**
|
|
923
|
+
* require function expressions to have a name
|
|
924
|
+
* https://eslint.org/docs/rules/func-names
|
|
925
|
+
*/
|
|
926
|
+
"func-names": "off",
|
|
927
|
+
/**
|
|
928
|
+
* enforces use of function declarations or expressions
|
|
929
|
+
* https://eslint.org/docs/rules/func-style
|
|
930
|
+
*/
|
|
931
|
+
"func-style": ["off", "expression"],
|
|
932
|
+
/**
|
|
933
|
+
* enforce line breaks between arguments of a function call 🔧
|
|
934
|
+
* https://eslint.org/docs/rules/function-call-argument-newline
|
|
935
|
+
*/
|
|
936
|
+
"function-call-argument-newline": ["off", "consistent"],
|
|
937
|
+
/**
|
|
938
|
+
* enforce consistent line breaks inside function parentheses 🔧
|
|
939
|
+
* https://eslint.org/docs/rules/function-paren-newline
|
|
940
|
+
* Disabled because it results in conflicts with Prettier
|
|
941
|
+
*/
|
|
942
|
+
"function-paren-newline": "off",
|
|
943
|
+
/**
|
|
944
|
+
* Blacklist certain identifiers to prevent them being used
|
|
945
|
+
* https://eslint.org/docs/rules/id-blacklist
|
|
946
|
+
*/
|
|
947
|
+
"id-blacklist": "off",
|
|
948
|
+
/**
|
|
949
|
+
* disallow specified identifiers
|
|
950
|
+
* https://eslint.org/docs/rules/id-denylist
|
|
951
|
+
*/
|
|
952
|
+
"id-denylist": "off",
|
|
953
|
+
/**
|
|
954
|
+
* this option enforces minimum and maximum identifier
|
|
955
|
+
* lengths (variable names, property names etc.)
|
|
956
|
+
* https://eslint.org/docs/rules/id-length
|
|
957
|
+
*/
|
|
958
|
+
"id-length": "off",
|
|
959
|
+
/**
|
|
960
|
+
* require identifiers to match the provided regular expression
|
|
961
|
+
* https://eslint.org/docs/rules/id-match
|
|
962
|
+
*/
|
|
963
|
+
"id-match": "off",
|
|
964
|
+
/**
|
|
965
|
+
* Enforce the location of arrow function bodies with implicit returns 🔧
|
|
966
|
+
* https://eslint.org/docs/rules/implicit-arrow-linebreak
|
|
967
|
+
* Disabled because it results in conflicts with Prettier
|
|
968
|
+
*/
|
|
969
|
+
"implicit-arrow-linebreak": "off",
|
|
970
|
+
/**
|
|
971
|
+
* specify whether double or single quotes should be used in JSX attributes 🔧
|
|
972
|
+
* https://eslint.org/docs/rules/jsx-quotes
|
|
973
|
+
*/
|
|
974
|
+
"jsx-quotes": "error",
|
|
975
|
+
/**
|
|
976
|
+
* enforces spacing between keys and values in object literal properties 🔧
|
|
977
|
+
* https://eslint.org/docs/rules/key-spacing
|
|
978
|
+
*/
|
|
979
|
+
"key-spacing": "error",
|
|
980
|
+
/**
|
|
981
|
+
* require a space before & after certain keywords 🔧
|
|
982
|
+
* https://eslint.style/rules/ts/keyword-spacing#ts-keyword-spacing
|
|
983
|
+
*/
|
|
984
|
+
"@stylistic/keyword-spacing": "error",
|
|
985
|
+
/**
|
|
986
|
+
* enforce position of line comments
|
|
987
|
+
* https://eslint.org/docs/rules/line-comment-position
|
|
988
|
+
*/
|
|
989
|
+
"line-comment-position": "error",
|
|
990
|
+
/**
|
|
991
|
+
* disallow mixed 'LF' and 'CRLF' as linebreaks 🔧
|
|
992
|
+
* https://eslint.org/docs/rules/linebreak-style
|
|
993
|
+
*/
|
|
994
|
+
"linebreak-style": "error",
|
|
995
|
+
/**
|
|
996
|
+
* enforces empty lines around comments 🔧
|
|
997
|
+
* https://eslint.org/docs/rules/lines-around-comment
|
|
998
|
+
*/
|
|
999
|
+
"lines-around-comment": "off",
|
|
1000
|
+
/**
|
|
1001
|
+
* require or disallow an empty line between class members 🔧
|
|
1002
|
+
* https://eslint.style/rules/ts/lines-between-class-members#ts-lines-between-class-members
|
|
1003
|
+
*/
|
|
1004
|
+
"@stylistic/lines-between-class-members": "error",
|
|
1005
|
+
/**
|
|
1006
|
+
* specify the maximum depth that blocks can be nested
|
|
1007
|
+
* https://eslint.org/docs/rules/max-depth
|
|
1008
|
+
*/
|
|
1009
|
+
"max-depth": "warn",
|
|
1010
|
+
/**
|
|
1011
|
+
* specify the maximum length of a line in your program
|
|
1012
|
+
* https://eslint.org/docs/rules/max-len
|
|
1013
|
+
*/
|
|
1014
|
+
"max-len": [
|
|
1015
|
+
"error",
|
|
1016
|
+
{
|
|
1017
|
+
code: 100,
|
|
1018
|
+
tabWidth: 2,
|
|
1019
|
+
ignoreUrls: !0,
|
|
1020
|
+
ignoreComments: !1,
|
|
1021
|
+
ignoreRegExpLiterals: !0,
|
|
1022
|
+
ignoreStrings: !0,
|
|
1023
|
+
ignoreTemplateLiterals: !0
|
|
1024
|
+
}
|
|
1025
|
+
],
|
|
1026
|
+
/**
|
|
1027
|
+
* specify the max number of lines in a file
|
|
1028
|
+
* https://eslint.org/docs/rules/max-lines
|
|
1029
|
+
*/
|
|
1030
|
+
"max-lines": "off",
|
|
1031
|
+
/**
|
|
1032
|
+
* enforce a maximum function length
|
|
1033
|
+
* https://eslint.org/docs/rules/max-lines-per-function
|
|
1034
|
+
*/
|
|
1035
|
+
"max-lines-per-function": "off",
|
|
1036
|
+
/**
|
|
1037
|
+
* specify the maximum depth callbacks can be nested
|
|
1038
|
+
* https://eslint.org/docs/rules/max-nested-callbacks
|
|
1039
|
+
*/
|
|
1040
|
+
"max-nested-callbacks": "off",
|
|
1041
|
+
/**
|
|
1042
|
+
* limits the number of parameters that can be used in the function declaration.
|
|
1043
|
+
* https://eslint.org/docs/rules/max-params
|
|
1044
|
+
*/
|
|
1045
|
+
"max-params": "off",
|
|
1046
|
+
/**
|
|
1047
|
+
* specify the maximum number of statement allowed in a function
|
|
1048
|
+
* https://eslint.org/docs/rules/max-statements
|
|
1049
|
+
*/
|
|
1050
|
+
"max-statements": "off",
|
|
1051
|
+
/**
|
|
1052
|
+
* restrict the number of statements per line
|
|
1053
|
+
* https://eslint.org/docs/rules/max-statements-per-line
|
|
1054
|
+
*/
|
|
1055
|
+
"max-statements-per-line": "off",
|
|
1056
|
+
/**
|
|
1057
|
+
* enforce a particular style for multiline comments 🔧
|
|
1058
|
+
* https://eslint.org/docs/rules/multiline-comment-style
|
|
1059
|
+
*/
|
|
1060
|
+
"multiline-comment-style": "off",
|
|
1061
|
+
/**
|
|
1062
|
+
* require multiline ternary 🔧
|
|
1063
|
+
* https://eslint.org/docs/rules/multiline-ternary
|
|
1064
|
+
*/
|
|
1065
|
+
"multiline-ternary": "off",
|
|
1066
|
+
/**
|
|
1067
|
+
* require a capital letter for constructors
|
|
1068
|
+
* https://eslint.org/docs/rules/new-cap
|
|
1069
|
+
*/
|
|
1070
|
+
"new-cap": "error",
|
|
1071
|
+
/**
|
|
1072
|
+
* disallow the omission of parentheses when invoking a constructor with no arguments 🔧
|
|
1073
|
+
* https://eslint.org/docs/rules/new-parens
|
|
1074
|
+
*/
|
|
1075
|
+
"new-parens": "error",
|
|
1076
|
+
/**
|
|
1077
|
+
* enforces new line after each method call in the chain
|
|
1078
|
+
* to make it more readable and easy to maintain 🔧
|
|
1079
|
+
* https://eslint.org/docs/rules/newline-per-chained-call
|
|
1080
|
+
*/
|
|
1081
|
+
"newline-per-chained-call": "error",
|
|
1082
|
+
/**
|
|
1083
|
+
* disallow use of the Array constructor
|
|
1084
|
+
* https://eslint.org/docs/rules/no-array-constructor
|
|
1085
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-array-constructor.md
|
|
1086
|
+
*/
|
|
1087
|
+
"no-array-constructor": "off",
|
|
1088
|
+
"@typescript-eslint/no-array-constructor": "error",
|
|
1089
|
+
/**
|
|
1090
|
+
* disallow use of bitwise operators
|
|
1091
|
+
* https://eslint.org/docs/rules/no-bitwise
|
|
1092
|
+
*/
|
|
1093
|
+
"no-bitwise": "warn",
|
|
1094
|
+
/**
|
|
1095
|
+
* disallow use of the continue statement
|
|
1096
|
+
* https://eslint.org/docs/rules/no-continue
|
|
1097
|
+
*/
|
|
1098
|
+
"no-continue": "error",
|
|
1099
|
+
/**
|
|
1100
|
+
* disallow comments inline after code
|
|
1101
|
+
* https://eslint.org/docs/rules/no-inline-comments
|
|
1102
|
+
*/
|
|
1103
|
+
"no-inline-comments": "error",
|
|
1104
|
+
/**
|
|
1105
|
+
* disallow if as the only statement in an else block 🔧
|
|
1106
|
+
* https://eslint.org/docs/rules/no-lonely-if
|
|
1107
|
+
*/
|
|
1108
|
+
"no-lonely-if": "error",
|
|
1109
|
+
/**
|
|
1110
|
+
* disallow un-paren'd mixes of different operators
|
|
1111
|
+
* https://eslint.org/docs/rules/no-mixed-operators
|
|
1112
|
+
*/
|
|
1113
|
+
"no-mixed-operators": "error",
|
|
1114
|
+
/**
|
|
1115
|
+
* disallow mixed spaces and tabs for indentation ✅
|
|
1116
|
+
* https://eslint.org/docs/rules/no-mixed-spaces-and-tabs
|
|
1117
|
+
*/
|
|
1118
|
+
"no-mixed-spaces-and-tabs": "error",
|
|
1119
|
+
/**
|
|
1120
|
+
* disallow use of chained assignment expressions
|
|
1121
|
+
* https://eslint.org/docs/rules/no-multi-assign
|
|
1122
|
+
*/
|
|
1123
|
+
"no-multi-assign": "error",
|
|
1124
|
+
/**
|
|
1125
|
+
* disallow multiple empty lines, only one newline at the end, and no new lines at the beginning 🔧
|
|
1126
|
+
* https://eslint.org/docs/rules/no-multiple-empty-lines
|
|
1127
|
+
*/
|
|
1128
|
+
"no-multiple-empty-lines": ["error", { max: 1, maxBOF: 0, maxEOF: 0 }],
|
|
1129
|
+
/**
|
|
1130
|
+
* disallow negated conditions
|
|
1131
|
+
* https://eslint.org/docs/rules/no-negated-condition
|
|
1132
|
+
*/
|
|
1133
|
+
"no-negated-condition": "off",
|
|
1134
|
+
/**
|
|
1135
|
+
* disallow nested ternary expressions
|
|
1136
|
+
* https://eslint.org/docs/rules/no-nested-ternary
|
|
1137
|
+
*/
|
|
1138
|
+
"no-nested-ternary": "error",
|
|
1139
|
+
/**
|
|
1140
|
+
* disallow use of the Object constructor
|
|
1141
|
+
* https://eslint.org/docs/rules/no-new-object
|
|
1142
|
+
*/
|
|
1143
|
+
"no-new-object": "error",
|
|
1144
|
+
/**
|
|
1145
|
+
* disallow use of unary operators, ++ and --
|
|
1146
|
+
* https://eslint.org/docs/rules/no-plusplus
|
|
1147
|
+
*/
|
|
1148
|
+
"no-plusplus": "error",
|
|
1149
|
+
/**
|
|
1150
|
+
* disallow certain syntax forms
|
|
1151
|
+
* https://eslint.org/docs/rules/no-restricted-syntax
|
|
1152
|
+
*/
|
|
1153
|
+
"no-restricted-syntax": [
|
|
1154
|
+
"error",
|
|
1155
|
+
{
|
|
1156
|
+
selector: "ForInStatement",
|
|
1157
|
+
message: "for-in loops are disallowed. (https://github.com/SPSCommerce/javascript#iterators--no-for-in)"
|
|
1158
|
+
},
|
|
1159
|
+
{
|
|
1160
|
+
selector: "LabeledStatement",
|
|
1161
|
+
message: "Labeled statements are disallowed. (https://github.com/SPSCommerce/javascript#control-statements--value-selection)"
|
|
1162
|
+
}
|
|
1163
|
+
],
|
|
1164
|
+
/**
|
|
1165
|
+
* disallow tab characters entirely
|
|
1166
|
+
* https://eslint.org/docs/rules/no-tabs
|
|
1167
|
+
*/
|
|
1168
|
+
"no-tabs": "error",
|
|
1169
|
+
/**
|
|
1170
|
+
* disallow the use of ternary operators
|
|
1171
|
+
* https://eslint.org/docs/rules/no-ternary
|
|
1172
|
+
*/
|
|
1173
|
+
"no-ternary": "off",
|
|
1174
|
+
/**
|
|
1175
|
+
* disallow trailing whitespace at the end of lines 🔧
|
|
1176
|
+
* https://eslint.org/docs/rules/no-trailing-spaces
|
|
1177
|
+
*/
|
|
1178
|
+
"no-trailing-spaces": "error",
|
|
1179
|
+
/**
|
|
1180
|
+
* disallow dangling underscores in identifiers
|
|
1181
|
+
* https://eslint.org/docs/rules/no-underscore-dangle
|
|
1182
|
+
*/
|
|
1183
|
+
"no-underscore-dangle": ["error", { enforceInMethodNames: !0 }],
|
|
1184
|
+
/**
|
|
1185
|
+
* prefer `a || b` over `a ? a : b` 🔧
|
|
1186
|
+
* https://eslint.org/docs/rules/no-unneeded-ternary
|
|
1187
|
+
*/
|
|
1188
|
+
"no-unneeded-ternary": ["error", { defaultAssignment: !1 }],
|
|
1189
|
+
/**
|
|
1190
|
+
* disallow whitespace before properties 🔧
|
|
1191
|
+
* https://eslint.org/docs/rules/no-whitespace-before-property
|
|
1192
|
+
*/
|
|
1193
|
+
"no-whitespace-before-property": "error",
|
|
1194
|
+
/**
|
|
1195
|
+
* enforce the location of single-line statements 🔧
|
|
1196
|
+
* https://eslint.org/docs/rules/nonblock-statement-body-position
|
|
1197
|
+
*/
|
|
1198
|
+
"nonblock-statement-body-position": "error",
|
|
1199
|
+
/**
|
|
1200
|
+
* enforce line breaks between braces 🔧
|
|
1201
|
+
* https://eslint.org/docs/rules/object-curly-newline
|
|
1202
|
+
*/
|
|
1203
|
+
"object-curly-newline": "off",
|
|
1204
|
+
/**
|
|
1205
|
+
* require padding inside curly braces 🔧
|
|
1206
|
+
* https://eslint.style/rules/ts/object-curly-spacing#ts-object-curly-spacing
|
|
1207
|
+
*/
|
|
1208
|
+
"@stylistic/object-curly-spacing": ["error", "always"],
|
|
1209
|
+
/**
|
|
1210
|
+
* enforce "same line" or "multiple line" on object properties. 🔧
|
|
1211
|
+
* https://eslint.org/docs/rules/object-property-newline
|
|
1212
|
+
*/
|
|
1213
|
+
"object-property-newline": ["error", { allowAllPropertiesOnSameLine: !0 }],
|
|
1214
|
+
/**
|
|
1215
|
+
* allow just one variable declaration per function 🔧
|
|
1216
|
+
* https://eslint.org/docs/rules/one-var
|
|
1217
|
+
* nb: despite 'var' being in the name, does apply to let and const
|
|
1218
|
+
*/
|
|
1219
|
+
"one-var": ["error", "never"],
|
|
1220
|
+
/**
|
|
1221
|
+
* require a newline around variable declaration 🔧
|
|
1222
|
+
* https://eslint.org/docs/rules/one-var-declaration-per-line
|
|
1223
|
+
*/
|
|
1224
|
+
"one-var-declaration-per-line": ["error", "always"],
|
|
1225
|
+
/**
|
|
1226
|
+
* require assignment operator shorthand where possible or prohibit it entirely 🔧
|
|
1227
|
+
* https://eslint.org/docs/rules/operator-assignment
|
|
1228
|
+
*/
|
|
1229
|
+
"operator-assignment": "error",
|
|
1230
|
+
/**
|
|
1231
|
+
* Requires operator at the beginning of the line in multiline statements 🔧
|
|
1232
|
+
* https://eslint.org/docs/rules/operator-linebreak
|
|
1233
|
+
* Disabled because it results in conflicts with Prettier
|
|
1234
|
+
*/
|
|
1235
|
+
"operator-linebreak": "off",
|
|
1236
|
+
/**
|
|
1237
|
+
* disallow padding within blocks 🔧
|
|
1238
|
+
* https://eslint.org/docs/rules/padded-blocks
|
|
1239
|
+
*/
|
|
1240
|
+
"padded-blocks": [
|
|
1241
|
+
"error",
|
|
1242
|
+
{
|
|
1243
|
+
blocks: "never",
|
|
1244
|
+
classes: "never",
|
|
1245
|
+
switches: "never"
|
|
1246
|
+
},
|
|
1247
|
+
{
|
|
1248
|
+
allowSingleLineBlocks: !0
|
|
1249
|
+
}
|
|
1250
|
+
],
|
|
1251
|
+
/**
|
|
1252
|
+
* Require or disallow padding lines between statements 🔧
|
|
1253
|
+
* https://eslint.org/docs/rules/padding-line-between-statements
|
|
1254
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/padding-line-between-statements.md
|
|
1255
|
+
*/
|
|
1256
|
+
"padding-line-between-statements": "off",
|
|
1257
|
+
"@typescript-eslint/padding-line-between-statements": "off",
|
|
1258
|
+
/**
|
|
1259
|
+
* Disallow the use of Math.pow in favor of the ** operator 🔧
|
|
1260
|
+
* https://eslint.org/docs/rules/prefer-exponentiation-operator
|
|
1261
|
+
*/
|
|
1262
|
+
"prefer-exponentiation-operator": "off",
|
|
1263
|
+
/**
|
|
1264
|
+
* Prefer use of an object spread over Object.assign 🔧
|
|
1265
|
+
* https://eslint.org/docs/rules/prefer-object-spread
|
|
1266
|
+
*/
|
|
1267
|
+
"prefer-object-spread": "error",
|
|
1268
|
+
/**
|
|
1269
|
+
* require quotes around object literal property names 🔧
|
|
1270
|
+
* https://eslint.org/docs/rules/quote-props
|
|
1271
|
+
*/
|
|
1272
|
+
"quote-props": [
|
|
1273
|
+
"error",
|
|
1274
|
+
"as-needed",
|
|
1275
|
+
{ keywords: !1, numbers: !1 }
|
|
1276
|
+
],
|
|
1277
|
+
/**
|
|
1278
|
+
* specify whether double or single quotes should be used 🔧
|
|
1279
|
+
* https://eslint.style/rules/ts/quotes#ts-quotes
|
|
1280
|
+
*/
|
|
1281
|
+
"@stylistic/quotes": [
|
|
1282
|
+
"error",
|
|
1283
|
+
"double",
|
|
1284
|
+
{ avoidEscape: !0 }
|
|
1285
|
+
],
|
|
1286
|
+
/**
|
|
1287
|
+
* require or disallow use of semicolons instead of ASI 🔧
|
|
1288
|
+
* https://eslint.style/rules/ts/semi#ts-semi
|
|
1289
|
+
*/
|
|
1290
|
+
"@stylistic/semi": "error",
|
|
1291
|
+
/**
|
|
1292
|
+
* enforce spacing before and after semicolons 🔧
|
|
1293
|
+
* https://eslint.org/docs/rules/semi-spacing
|
|
1294
|
+
*/
|
|
1295
|
+
"semi-spacing": "error",
|
|
1296
|
+
/**
|
|
1297
|
+
* Enforce location of semicolons 🔧
|
|
1298
|
+
* https://eslint.org/docs/rules/semi-style
|
|
1299
|
+
*/
|
|
1300
|
+
"semi-style": "error",
|
|
1301
|
+
/**
|
|
1302
|
+
* requires object keys to be sorted
|
|
1303
|
+
* https://eslint.org/docs/rules/sort-keys
|
|
1304
|
+
*/
|
|
1305
|
+
"sort-keys": "off",
|
|
1306
|
+
/**
|
|
1307
|
+
* sort variables within the same declaration block 🔧
|
|
1308
|
+
* https://eslint.org/docs/rules/sort-vars
|
|
1309
|
+
*/
|
|
1310
|
+
"sort-vars": "off",
|
|
1311
|
+
/**
|
|
1312
|
+
* require or disallow space before blocks 🔧
|
|
1313
|
+
* https://eslint.org/docs/rules/space-before-blocks
|
|
1314
|
+
*/
|
|
1315
|
+
"space-before-blocks": "error",
|
|
1316
|
+
/**
|
|
1317
|
+
* require or disallow space before function opening parenthesis 🔧
|
|
1318
|
+
* https://eslint.style/rules/ts/space-before-function-paren#ts-space-before-function-paren
|
|
1319
|
+
*/
|
|
1320
|
+
"@stylistic/space-before-function-paren": [
|
|
1321
|
+
"error",
|
|
1322
|
+
{
|
|
1323
|
+
anonymous: "always",
|
|
1324
|
+
named: "never",
|
|
1325
|
+
asyncArrow: "always"
|
|
1326
|
+
}
|
|
1327
|
+
],
|
|
1328
|
+
/**
|
|
1329
|
+
* require or disallow spaces inside parentheses 🔧
|
|
1330
|
+
* https://eslint.org/docs/rules/space-in-parens
|
|
1331
|
+
*/
|
|
1332
|
+
"space-in-parens": "error",
|
|
1333
|
+
/**
|
|
1334
|
+
* require spaces around operators 🔧
|
|
1335
|
+
* https://eslint.style/rules/ts/space-infix-ops#ts-space-infix-ops
|
|
1336
|
+
*/
|
|
1337
|
+
"@stylistic/space-infix-ops": "error",
|
|
1338
|
+
/**
|
|
1339
|
+
* Require or disallow spaces before/after unary operators 🔧
|
|
1340
|
+
* https://eslint.org/docs/rules/space-unary-ops
|
|
1341
|
+
*/
|
|
1342
|
+
"space-unary-ops": "error",
|
|
1343
|
+
/**
|
|
1344
|
+
* require or disallow a space immediately following the // or /* in a comment 🔧
|
|
1345
|
+
* https://eslint.org/docs/rules/spaced-comment
|
|
1346
|
+
*/
|
|
1347
|
+
"spaced-comment": "error",
|
|
1348
|
+
/**
|
|
1349
|
+
* Enforce spacing around colons of switch statements 🔧
|
|
1350
|
+
* https://eslint.org/docs/rules/switch-colon-spacing
|
|
1351
|
+
*/
|
|
1352
|
+
"switch-colon-spacing": "error",
|
|
1353
|
+
/**
|
|
1354
|
+
* Require or disallow spacing between template tags and their literals 🔧
|
|
1355
|
+
* https://eslint.org/docs/rules/template-tag-spacing
|
|
1356
|
+
*/
|
|
1357
|
+
"template-tag-spacing": "error",
|
|
1358
|
+
/**
|
|
1359
|
+
* require or disallow the Unicode Byte Order Mark 🔧
|
|
1360
|
+
* https://eslint.org/docs/rules/unicode-bom
|
|
1361
|
+
*/
|
|
1362
|
+
"unicode-bom": "error",
|
|
1363
|
+
/**
|
|
1364
|
+
* require regex literals to be wrapped in parentheses 🔧
|
|
1365
|
+
* https://eslint.org/docs/rules/wrap-regex
|
|
1366
|
+
*/
|
|
1367
|
+
"wrap-regex": "off"
|
|
1368
|
+
}, l = {
|
|
1369
|
+
/**
|
|
1370
|
+
* enforces no braces where they can be omitted 🔧
|
|
1371
|
+
* https://eslint.org/docs/rules/arrow-body-style
|
|
1372
|
+
*/
|
|
1373
|
+
"arrow-body-style": "error",
|
|
1374
|
+
/**
|
|
1375
|
+
* require parens in arrow function arguments 🔧
|
|
1376
|
+
* https://eslint.org/docs/rules/arrow-parens
|
|
1377
|
+
*/
|
|
1378
|
+
"arrow-parens": "error",
|
|
1379
|
+
/**
|
|
1380
|
+
* require space before/after arrow function's arrow 🔧
|
|
1381
|
+
* https://eslint.org/docs/rules/arrow-spacing
|
|
1382
|
+
*/
|
|
1383
|
+
"arrow-spacing": "error",
|
|
1384
|
+
/**
|
|
1385
|
+
* verify super() callings in constructors ✅
|
|
1386
|
+
* https://eslint.org/docs/rules/constructor-super
|
|
1387
|
+
*/
|
|
1388
|
+
"constructor-super": "error",
|
|
1389
|
+
/**
|
|
1390
|
+
* enforce the spacing around the * in generator functions 🔧
|
|
1391
|
+
* https://eslint.org/docs/rules/generator-star-spacing
|
|
1392
|
+
*/
|
|
1393
|
+
"generator-star-spacing": ["error", { before: !1, after: !0 }],
|
|
1394
|
+
/**
|
|
1395
|
+
* enforce logical assignment operators
|
|
1396
|
+
* https://eslint.org/docs/rules/logical-assignment-operators
|
|
1397
|
+
*/
|
|
1398
|
+
"logical-assignment-operators": "error",
|
|
1399
|
+
/**
|
|
1400
|
+
* disallow modifying variables of class declarations ✅
|
|
1401
|
+
* https://eslint.org/docs/rules/no-class-assign
|
|
1402
|
+
*/
|
|
1403
|
+
"no-class-assign": "error",
|
|
1404
|
+
/**
|
|
1405
|
+
* disallow arrow functions where they could be confused with comparisons 🔧
|
|
1406
|
+
* https://eslint.org/docs/rules/no-confusing-arrow
|
|
1407
|
+
*/
|
|
1408
|
+
"no-confusing-arrow": ["error", { allowParens: !0 }],
|
|
1409
|
+
/**
|
|
1410
|
+
* disallow modifying variables that are declared using const ✅
|
|
1411
|
+
* https://eslint.org/docs/rules/no-const-assign
|
|
1412
|
+
*/
|
|
1413
|
+
"no-const-assign": "error",
|
|
1414
|
+
/**
|
|
1415
|
+
* disallow duplicate class members ✅
|
|
1416
|
+
* https://eslint.org/docs/rules/no-dupe-class-members
|
|
1417
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-dupe-class-members.md
|
|
1418
|
+
*/
|
|
1419
|
+
"no-dupe-class-members": "off",
|
|
1420
|
+
"@typescript-eslint/no-dupe-class-members": "error",
|
|
1421
|
+
/**
|
|
1422
|
+
* disallow importing from the same path more than once
|
|
1423
|
+
* https://eslint.org/docs/rules/no-duplicate-imports
|
|
1424
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-duplicate-imports.md
|
|
1425
|
+
* superceded by eslint-plugin-import
|
|
1426
|
+
*/
|
|
1427
|
+
"no-duplicate-import": "off",
|
|
1428
|
+
"no-duplicate-imports": "off",
|
|
1429
|
+
/**
|
|
1430
|
+
* disallow symbol constructor ✅
|
|
1431
|
+
* https://eslint.org/docs/rules/no-new-symbol
|
|
1432
|
+
*/
|
|
1433
|
+
"no-new-symbol": "error",
|
|
1434
|
+
/**
|
|
1435
|
+
* Disallow specified names in exports
|
|
1436
|
+
* https://eslint.org/docs/rules/no-restricted-exports
|
|
1437
|
+
*/
|
|
1438
|
+
"no-restricted-exports": "off",
|
|
1439
|
+
/**
|
|
1440
|
+
* disallow specific imports
|
|
1441
|
+
* https://eslint.org/docs/rules/no-restricted-imports
|
|
1442
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-restricted-imports.md
|
|
1443
|
+
*/
|
|
1444
|
+
"no-restricted-imports": "off",
|
|
1445
|
+
"@typescript-eslint/no-restricted-imports": "off",
|
|
1446
|
+
/**
|
|
1447
|
+
* disallow to use this/super before super() calling in constructors. ✅
|
|
1448
|
+
* https://eslint.org/docs/rules/no-this-before-super
|
|
1449
|
+
*/
|
|
1450
|
+
"no-this-before-super": "error",
|
|
1451
|
+
/**
|
|
1452
|
+
* disallow useless computed property keys 🔧
|
|
1453
|
+
* https://eslint.org/docs/rules/no-useless-computed-key
|
|
1454
|
+
*/
|
|
1455
|
+
"no-useless-computed-key": "error",
|
|
1456
|
+
/**
|
|
1457
|
+
* disallow unnecessary constructor
|
|
1458
|
+
* https://eslint.org/docs/rules/no-useless-constructor
|
|
1459
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-useless-constructor.md
|
|
1460
|
+
*/
|
|
1461
|
+
"no-useless-constructor": "off",
|
|
1462
|
+
"@typescript-eslint/no-useless-constructor": "error",
|
|
1463
|
+
/**
|
|
1464
|
+
* disallow renaming import, export, and destructured assignments to the same name 🔧
|
|
1465
|
+
* https://eslint.org/docs/rules/no-useless-rename
|
|
1466
|
+
*/
|
|
1467
|
+
"no-useless-rename": "error",
|
|
1468
|
+
/**
|
|
1469
|
+
* require let or const instead of var 🔧
|
|
1470
|
+
* https://eslint.org/docs/rules/no-var
|
|
1471
|
+
*/
|
|
1472
|
+
"no-var": "error",
|
|
1473
|
+
/**
|
|
1474
|
+
* require method and property shorthand syntax for object literals 🔧
|
|
1475
|
+
* https://eslint.org/docs/rules/object-shorthand
|
|
1476
|
+
*/
|
|
1477
|
+
"object-shorthand": [
|
|
1478
|
+
"error",
|
|
1479
|
+
"always",
|
|
1480
|
+
{ avoidQuotes: !0 }
|
|
1481
|
+
],
|
|
1482
|
+
/**
|
|
1483
|
+
* suggest using arrow functions as callbacks 🔧
|
|
1484
|
+
* https://eslint.org/docs/rules/prefer-arrow-callback
|
|
1485
|
+
*/
|
|
1486
|
+
"prefer-arrow-callback": "error",
|
|
1487
|
+
/**
|
|
1488
|
+
* suggest using of const declaration for variables that are never modified after declared 🔧
|
|
1489
|
+
* https://eslint.org/docs/rules/prefer-const
|
|
1490
|
+
*/
|
|
1491
|
+
"prefer-const": ["error", { ignoreReadBeforeAssign: !0 }],
|
|
1492
|
+
/**
|
|
1493
|
+
* Prefer destructuring from arrays and objects 🔧
|
|
1494
|
+
* https://eslint.org/docs/rules/prefer-destructuring
|
|
1495
|
+
*/
|
|
1496
|
+
"prefer-destructuring": [
|
|
1497
|
+
"error",
|
|
1498
|
+
{
|
|
1499
|
+
VariableDeclarator: {
|
|
1500
|
+
array: !1,
|
|
1501
|
+
object: !0
|
|
1502
|
+
},
|
|
1503
|
+
AssignmentExpression: {
|
|
1504
|
+
array: !0,
|
|
1505
|
+
object: !1
|
|
1506
|
+
}
|
|
1507
|
+
},
|
|
1508
|
+
{
|
|
1509
|
+
enforceForRenamedProperties: !1
|
|
1510
|
+
}
|
|
1511
|
+
],
|
|
1512
|
+
/**
|
|
1513
|
+
* prefer exponentiation operator
|
|
1514
|
+
* https://eslint.org/docs/rules/prefer-exponentiation-operator
|
|
1515
|
+
*/
|
|
1516
|
+
"prefer-exponentiation-operator": "error",
|
|
1517
|
+
/**
|
|
1518
|
+
* disallow parseInt() in favor of binary, octal, and hexadecimal literals 🔧
|
|
1519
|
+
* https://eslint.org/docs/rules/prefer-numeric-literals
|
|
1520
|
+
*/
|
|
1521
|
+
"prefer-numeric-literals": "error",
|
|
1522
|
+
/**
|
|
1523
|
+
* suggest using Reflect methods where applicable
|
|
1524
|
+
* https://eslint.org/docs/rules/prefer-reflect
|
|
1525
|
+
*/
|
|
1526
|
+
"prefer-reflect": "off",
|
|
1527
|
+
/**
|
|
1528
|
+
* use rest parameters instead of arguments
|
|
1529
|
+
* https://eslint.org/docs/rules/prefer-rest-params
|
|
1530
|
+
*/
|
|
1531
|
+
"prefer-rest-params": "error",
|
|
1532
|
+
/**
|
|
1533
|
+
* suggest using the spread syntax instead of .apply()
|
|
1534
|
+
* https://eslint.org/docs/rules/prefer-spread
|
|
1535
|
+
*/
|
|
1536
|
+
"prefer-spread": "error",
|
|
1537
|
+
/**
|
|
1538
|
+
* suggest using template literals instead of string concatenation 🔧
|
|
1539
|
+
* https://eslint.org/docs/rules/prefer-template
|
|
1540
|
+
*/
|
|
1541
|
+
"prefer-template": "error",
|
|
1542
|
+
/**
|
|
1543
|
+
* disallow generator functions that do not have yield ✅
|
|
1544
|
+
* https://eslint.org/docs/rules/require-yield
|
|
1545
|
+
*/
|
|
1546
|
+
"require-yield": "error",
|
|
1547
|
+
/**
|
|
1548
|
+
* enforce spacing between object rest-spread 🔧
|
|
1549
|
+
* https://eslint.org/docs/rules/rest-spread-spacing
|
|
1550
|
+
*/
|
|
1551
|
+
"rest-spread-spacing": "error",
|
|
1552
|
+
/**
|
|
1553
|
+
* import sorting 🔧
|
|
1554
|
+
* https://eslint.org/docs/rules/sort-imports
|
|
1555
|
+
*/
|
|
1556
|
+
"sort-imports": "off",
|
|
1557
|
+
/**
|
|
1558
|
+
* require a Symbol description
|
|
1559
|
+
* https://eslint.org/docs/rules/symbol-description
|
|
1560
|
+
*/
|
|
1561
|
+
"symbol-description": "error",
|
|
1562
|
+
/**
|
|
1563
|
+
* enforce usage of spacing in template strings 🔧
|
|
1564
|
+
* https://eslint.org/docs/rules/template-curly-spacing
|
|
1565
|
+
*/
|
|
1566
|
+
"template-curly-spacing": "error",
|
|
1567
|
+
/**
|
|
1568
|
+
* enforce spacing around the * in yield* expressions 🔧
|
|
1569
|
+
* https://eslint.org/docs/rules/yield-star-spacing
|
|
1570
|
+
*/
|
|
1571
|
+
"yield-star-spacing": "error"
|
|
1572
|
+
}, c = {
|
|
1573
|
+
/**
|
|
1574
|
+
* Ensure imports point to a file/module that can be resolved.
|
|
1575
|
+
* https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-unresolved.md
|
|
1576
|
+
*/
|
|
1577
|
+
"import/no-unresolved": "error",
|
|
1578
|
+
/**
|
|
1579
|
+
* Ensure named imports correspond to a named export in the remote file.
|
|
1580
|
+
* https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/named.md
|
|
1581
|
+
*/
|
|
1582
|
+
"import/named": "error",
|
|
1583
|
+
/**
|
|
1584
|
+
* Ensure a default export is present, given a default import.
|
|
1585
|
+
* https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/default.md
|
|
1586
|
+
*/
|
|
1587
|
+
"import/default": "error",
|
|
1588
|
+
/**
|
|
1589
|
+
* Ensure imported namespaces contain dereferenced properties as they are dereferenced.
|
|
1590
|
+
* https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/namespace.md
|
|
1591
|
+
*/
|
|
1592
|
+
"import/namespace": "error",
|
|
1593
|
+
/**
|
|
1594
|
+
* Restrict which files can be imported in a given folder
|
|
1595
|
+
* https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-restricted-paths.md
|
|
1596
|
+
*/
|
|
1597
|
+
"import/no-restricted-paths": "error",
|
|
1598
|
+
/**
|
|
1599
|
+
* Forbid import of modules using absolute paths
|
|
1600
|
+
* https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-absolute-path.md
|
|
1601
|
+
*/
|
|
1602
|
+
"import/no-absolute-path": "error",
|
|
1603
|
+
/**
|
|
1604
|
+
* Forbid `require()` calls with expressions
|
|
1605
|
+
* https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-dynamic-require.md
|
|
1606
|
+
*/
|
|
1607
|
+
"import/no-dynamic-require": "error",
|
|
1608
|
+
/**
|
|
1609
|
+
* Prevent importing the submodules of other modules
|
|
1610
|
+
* https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-internal-modules.md
|
|
1611
|
+
*/
|
|
1612
|
+
"import/no-internal-modules": "off",
|
|
1613
|
+
/**
|
|
1614
|
+
* Forbid webpack loader syntax in imports
|
|
1615
|
+
* https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-webpack-loader-syntax.md
|
|
1616
|
+
*/
|
|
1617
|
+
"import/no-webpack-loader-syntax": "error",
|
|
1618
|
+
/**
|
|
1619
|
+
* Forbid a module from importing itself
|
|
1620
|
+
* https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-self-import.md
|
|
1621
|
+
*/
|
|
1622
|
+
"import/no-self-import": "error",
|
|
1623
|
+
/**
|
|
1624
|
+
* Forbid a module from importing a module with a dependency path back to itself
|
|
1625
|
+
* https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-cycle.md
|
|
1626
|
+
*/
|
|
1627
|
+
"import/no-cycle": "error",
|
|
1628
|
+
/**
|
|
1629
|
+
* Prevent unnecessary path segments in import and require statements
|
|
1630
|
+
* https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-useless-path-segments.md
|
|
1631
|
+
*/
|
|
1632
|
+
"import/no-useless-path-segments": "error",
|
|
1633
|
+
/**
|
|
1634
|
+
* Forbid importing modules from parent directories
|
|
1635
|
+
* https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-relative-parent-imports.md
|
|
1636
|
+
*/
|
|
1637
|
+
"import/no-relative-parent-imports": "off",
|
|
1638
|
+
/**
|
|
1639
|
+
* Prevent importing packages through relative paths
|
|
1640
|
+
* https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-relative-packages.md
|
|
1641
|
+
*/
|
|
1642
|
+
"import/no-relative-packages": "off"
|
|
1643
|
+
}, f = {
|
|
1644
|
+
/**
|
|
1645
|
+
* Report any invalid exports, i.e. re-export of the same name
|
|
1646
|
+
* https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/export.md
|
|
1647
|
+
*/
|
|
1648
|
+
"import/export": "warn",
|
|
1649
|
+
/**
|
|
1650
|
+
* Report use of exported name as identifier of default export
|
|
1651
|
+
* https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-named-as-default.md
|
|
1652
|
+
*/
|
|
1653
|
+
"import/no-named-as-default": "warn",
|
|
1654
|
+
/**
|
|
1655
|
+
* Report use of exported name as property of default export
|
|
1656
|
+
* https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-named-as-default-member.md
|
|
1657
|
+
*/
|
|
1658
|
+
"import/no-named-as-default-member": "warn",
|
|
1659
|
+
/**
|
|
1660
|
+
* Report imported names marked with `@deprecated` documentation tag
|
|
1661
|
+
* https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-deprecated.md
|
|
1662
|
+
*/
|
|
1663
|
+
"import/no-deprecated": "warn",
|
|
1664
|
+
/**
|
|
1665
|
+
* Forbid the use of extraneous packages
|
|
1666
|
+
* https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-extraneous-dependencies.md
|
|
1667
|
+
*/
|
|
1668
|
+
"import/no-extraneous-dependencies": "warn",
|
|
1669
|
+
/**
|
|
1670
|
+
* Forbid the use of mutable exports with `var` or `let`.
|
|
1671
|
+
* https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-mutable-exports.md
|
|
1672
|
+
*/
|
|
1673
|
+
"import/no-mutable-exports": "error",
|
|
1674
|
+
/**
|
|
1675
|
+
* Report modules without exports, or exports without matching import in another module
|
|
1676
|
+
* https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-unused-modules.md
|
|
1677
|
+
*/
|
|
1678
|
+
"import/no-unused-modules": "warn"
|
|
1679
|
+
}, m = {
|
|
1680
|
+
/**
|
|
1681
|
+
* Report potentially ambiguous parse goal (`script` vs. `module`)
|
|
1682
|
+
* https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/unambiguous.md
|
|
1683
|
+
*/
|
|
1684
|
+
"import/unambiguous": "error",
|
|
1685
|
+
/**
|
|
1686
|
+
* Report CommonJS `require` calls and `module.exports` or `exports.*`.
|
|
1687
|
+
* https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-commonjs.md
|
|
1688
|
+
*/
|
|
1689
|
+
"import/no-commonjs": "error",
|
|
1690
|
+
/**
|
|
1691
|
+
* Report AMD `require` and `define` calls.
|
|
1692
|
+
* https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-amd.md
|
|
1693
|
+
*/
|
|
1694
|
+
"import/no-amd": "error",
|
|
1695
|
+
/**
|
|
1696
|
+
* No Node.js builtin modules.
|
|
1697
|
+
* https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-nodejs-modules.md
|
|
1698
|
+
*/
|
|
1699
|
+
"import/no-nodejs-modules": "error",
|
|
1700
|
+
/**
|
|
1701
|
+
* Forbid imports with CommonJS exports
|
|
1702
|
+
* https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-import-module-exports.md
|
|
1703
|
+
*/
|
|
1704
|
+
"import/no-import-module-exports": "error"
|
|
1705
|
+
}, y = {
|
|
1706
|
+
/**
|
|
1707
|
+
* Ensure all imports appear before other statements
|
|
1708
|
+
* https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/first.md
|
|
1709
|
+
*/
|
|
1710
|
+
"import/first": "error",
|
|
1711
|
+
/**
|
|
1712
|
+
* Ensure all exports appear after other statements
|
|
1713
|
+
* https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/exports-last.md
|
|
1714
|
+
*/
|
|
1715
|
+
"import/exports-last": "off",
|
|
1716
|
+
/**
|
|
1717
|
+
* Report repeated import of the same module in multiple places
|
|
1718
|
+
* https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-duplicates.md
|
|
1719
|
+
*/
|
|
1720
|
+
"import/no-duplicates": "error",
|
|
1721
|
+
/**
|
|
1722
|
+
* Forbid namespace (a.k.a. "wildcard" `*`) imports
|
|
1723
|
+
* https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-namespace.md
|
|
1724
|
+
*/
|
|
1725
|
+
"import/no-namespace": "off",
|
|
1726
|
+
/**
|
|
1727
|
+
* Ensure consistent use of file extension within the import path
|
|
1728
|
+
* https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/extensions.md
|
|
1729
|
+
*/
|
|
1730
|
+
"import/extensions": ["error", "never"],
|
|
1731
|
+
/**
|
|
1732
|
+
* Enforce a convention in module import order
|
|
1733
|
+
* https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/order.md
|
|
1734
|
+
*/
|
|
1735
|
+
"import/order": "error",
|
|
1736
|
+
/**
|
|
1737
|
+
* Enforce a newline after import statements
|
|
1738
|
+
* https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/newline-after-import.md
|
|
1739
|
+
*/
|
|
1740
|
+
"import/newline-after-import": "error",
|
|
1741
|
+
/**
|
|
1742
|
+
* Prefer a default export if module exports a single name
|
|
1743
|
+
* https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/prefer-default-export.md
|
|
1744
|
+
*/
|
|
1745
|
+
"import/prefer-default-export": "off",
|
|
1746
|
+
/**
|
|
1747
|
+
* Limit the maximum number of dependencies a module can have
|
|
1748
|
+
* https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/max-dependencies.md
|
|
1749
|
+
*/
|
|
1750
|
+
"import/max-dependencies": "off",
|
|
1751
|
+
/**
|
|
1752
|
+
* Forbid unassigned imports (e.g. `import 'foo';`)
|
|
1753
|
+
* https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-unassigned-import.md
|
|
1754
|
+
* The general idea that importing a module shouldn't have side effects is valid, but
|
|
1755
|
+
* there is an exception: many polyfill modules do this, so we can't really make it an error.
|
|
1756
|
+
*/
|
|
1757
|
+
"import/no-unassigned-import": "off",
|
|
1758
|
+
/**
|
|
1759
|
+
* Forbid named default exports
|
|
1760
|
+
* https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-named-default.md
|
|
1761
|
+
*/
|
|
1762
|
+
"import/no-named-default": "error",
|
|
1763
|
+
/**
|
|
1764
|
+
* Forbid default exports
|
|
1765
|
+
* https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-default-export.md
|
|
1766
|
+
*/
|
|
1767
|
+
"import/no-default-export": "off",
|
|
1768
|
+
/**
|
|
1769
|
+
* Forbid named exports
|
|
1770
|
+
* https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-named-export.md
|
|
1771
|
+
*/
|
|
1772
|
+
"import/no-named-export": "off",
|
|
1773
|
+
/**
|
|
1774
|
+
* Forbid anonymous values as default exports
|
|
1775
|
+
* https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-anonymous-default-export.md
|
|
1776
|
+
*/
|
|
1777
|
+
"import/no-anonymous-default-export": "error",
|
|
1778
|
+
/**
|
|
1779
|
+
* Prefer named exports to be grouped together in a single export declaration
|
|
1780
|
+
* https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/group-exports.md
|
|
1781
|
+
*/
|
|
1782
|
+
"import/group-exports": "off",
|
|
1783
|
+
/**
|
|
1784
|
+
* Enforce a leading comment with the webpackChunkName for dynamic imports
|
|
1785
|
+
* https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/dynamic-import-chunkname.md
|
|
1786
|
+
*/
|
|
1787
|
+
"import/dynamic-import-chunkname": "off"
|
|
1788
|
+
}, u = {
|
|
1789
|
+
/**
|
|
1790
|
+
* Require that member overloads be consecutive ✅
|
|
1791
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/adjacent-overload-signatures.md
|
|
1792
|
+
*/
|
|
1793
|
+
"@typescript-eslint/adjacent-overload-signatures": "error",
|
|
1794
|
+
/**
|
|
1795
|
+
* Requires using either `T[]` or `Array<T>` for arrays 🔧
|
|
1796
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/array-type.md
|
|
1797
|
+
*/
|
|
1798
|
+
"@typescript-eslint/array-type": ["error", { default: "array-simple" }],
|
|
1799
|
+
/**
|
|
1800
|
+
* Disallows awaiting a value that is not a Thenable ✅ 💭
|
|
1801
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/await-thenable.md
|
|
1802
|
+
*/
|
|
1803
|
+
"@typescript-eslint/await-thenable": "error",
|
|
1804
|
+
/**
|
|
1805
|
+
* Bans `@ts-<directive>` comments from being used or requires descriptions after directive ✅
|
|
1806
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/ban-ts-comment.md
|
|
1807
|
+
*/
|
|
1808
|
+
"@typescript-eslint/ban-ts-comment": "error",
|
|
1809
|
+
/**
|
|
1810
|
+
* Bans // tslint:<rule-flag> comments from being used 🔧
|
|
1811
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/ban-tslint-comment.md
|
|
1812
|
+
*/
|
|
1813
|
+
"@typescript-eslint/ban-tslint-comment": "off",
|
|
1814
|
+
/**
|
|
1815
|
+
* Ensures that literals on classes are exposed in a consistent style 🔧
|
|
1816
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/class-literal-property-style.md
|
|
1817
|
+
*/
|
|
1818
|
+
"@typescript-eslint/class-literal-property-style": ["error", "fields"],
|
|
1819
|
+
/**
|
|
1820
|
+
* Enforce or disallow the use of the record type 🔧
|
|
1821
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/consistent-indexed-object-style.md
|
|
1822
|
+
*/
|
|
1823
|
+
"@typescript-eslint/consistent-indexed-object-style": ["error", "record"],
|
|
1824
|
+
/**
|
|
1825
|
+
* Enforces consistent usage of type assertions
|
|
1826
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/consistent-type-assertions.md
|
|
1827
|
+
*/
|
|
1828
|
+
"@typescript-eslint/consistent-type-assertions": ["error", { assertionStyle: "as" }],
|
|
1829
|
+
/**
|
|
1830
|
+
* Consistent with type definition either `interface` or `type` 🔧
|
|
1831
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/consistent-type-definitions.md
|
|
1832
|
+
*/
|
|
1833
|
+
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
|
|
1834
|
+
/**
|
|
1835
|
+
* Enforces consistent usage of type imports 🔧
|
|
1836
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/consistent-type-imports.md
|
|
1837
|
+
*/
|
|
1838
|
+
"@typescript-eslint/consistent-type-imports": ["error", { prefer: "type-imports" }],
|
|
1839
|
+
/**
|
|
1840
|
+
* Require explicit return types on functions and class methods
|
|
1841
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/explicit-function-return-type.md
|
|
1842
|
+
*/
|
|
1843
|
+
"@typescript-eslint/explicit-function-return-type": "error",
|
|
1844
|
+
/**
|
|
1845
|
+
* Require explicit accessibility modifiers on class properties and methods 🔧
|
|
1846
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/explicit-member-accessibility.md
|
|
1847
|
+
*/
|
|
1848
|
+
"@typescript-eslint/explicit-member-accessibility": "off",
|
|
1849
|
+
/**
|
|
1850
|
+
* Require explicit return and argument types on exported
|
|
1851
|
+
* functions' and classes' public class methods ✅
|
|
1852
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/explicit-module-boundary-types.md
|
|
1853
|
+
*/
|
|
1854
|
+
"@typescript-eslint/explicit-module-boundary-types": "error",
|
|
1855
|
+
/**
|
|
1856
|
+
* Require a specific member delimiter style for interfaces and type literals 🔧
|
|
1857
|
+
* https://eslint.style/rules/default/member-delimiter-style#ts-member-delimiter-style
|
|
1858
|
+
*/
|
|
1859
|
+
"@stylistic/member-delimiter-style": "error",
|
|
1860
|
+
/**
|
|
1861
|
+
* Require a consistent member declaration order
|
|
1862
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/member-ordering.md
|
|
1863
|
+
*/
|
|
1864
|
+
"@typescript-eslint/member-ordering": "error",
|
|
1865
|
+
/**
|
|
1866
|
+
* Enforces using a particular method signature syntax 🔧
|
|
1867
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/method-signature-style.md
|
|
1868
|
+
*/
|
|
1869
|
+
"@typescript-eslint/method-signature-style": "error",
|
|
1870
|
+
/**
|
|
1871
|
+
* Enforces naming conventions for everything across a codebase 💭
|
|
1872
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/naming-convention.md
|
|
1873
|
+
*/
|
|
1874
|
+
"@typescript-eslint/naming-convention": "off",
|
|
1875
|
+
/**
|
|
1876
|
+
* Requires that `.toString()` is only called on objects
|
|
1877
|
+
* which provide useful information when stringified 💭
|
|
1878
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-base-to-string.md
|
|
1879
|
+
*/
|
|
1880
|
+
"@typescript-eslint/no-base-to-string": "error",
|
|
1881
|
+
/**
|
|
1882
|
+
* Disallow non-null assertion in locations that may be confusing 🔧
|
|
1883
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-confusing-non-null-assertion.md
|
|
1884
|
+
*/
|
|
1885
|
+
"@typescript-eslint/no-confusing-non-null-assertion": "error",
|
|
1886
|
+
/**
|
|
1887
|
+
* Requires expressions of type void to appear in statement position 🔧 💭
|
|
1888
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-confusing-void-expression.md
|
|
1889
|
+
*/
|
|
1890
|
+
"@typescript-eslint/no-confusing-void-expression": ["error", { ignoreArrowShorthand: !0 }],
|
|
1891
|
+
/**
|
|
1892
|
+
* Disallow the delete operator with computed key expressions 🔧
|
|
1893
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-dynamic-delete.md
|
|
1894
|
+
*/
|
|
1895
|
+
"@typescript-eslint/no-dynamic-delete": "error",
|
|
1896
|
+
/**
|
|
1897
|
+
* Disallow the declaration of empty interfaces ✅ 🔧
|
|
1898
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-empty-interface.md
|
|
1899
|
+
*/
|
|
1900
|
+
"@typescript-eslint/no-empty-interface": "error",
|
|
1901
|
+
/**
|
|
1902
|
+
* Disallow usage of the `object` type with an object literal
|
|
1903
|
+
* as a type annotation ✅
|
|
1904
|
+
*/
|
|
1905
|
+
"@typescript-eslint/no-empty-object-type": "error",
|
|
1906
|
+
/**
|
|
1907
|
+
* Disallow usage of the `any` type ✅ 🔧
|
|
1908
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-explicit-any.md
|
|
1909
|
+
*/
|
|
1910
|
+
"@typescript-eslint/no-explicit-any": "error",
|
|
1911
|
+
/**
|
|
1912
|
+
* Disallow extra non-null assertion ✅ 🔧
|
|
1913
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-extra-non-null-assertion.md
|
|
1914
|
+
*/
|
|
1915
|
+
"@typescript-eslint/no-extra-non-null-assertion": "error",
|
|
1916
|
+
/**
|
|
1917
|
+
* Forbids the use of classes as namespaces
|
|
1918
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-extraneous-class.md
|
|
1919
|
+
*/
|
|
1920
|
+
"@typescript-eslint/no-extraneous-class": "error",
|
|
1921
|
+
/**
|
|
1922
|
+
* Requires Promise-like values to be handled appropriately ✅ 💭
|
|
1923
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-floating-promises.md
|
|
1924
|
+
*/
|
|
1925
|
+
"@typescript-eslint/no-floating-promises": "error",
|
|
1926
|
+
/**
|
|
1927
|
+
* Disallow iterating over an array with a for-in loop ✅ 💭
|
|
1928
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-for-in-array.md
|
|
1929
|
+
*/
|
|
1930
|
+
"@typescript-eslint/no-for-in-array": "error",
|
|
1931
|
+
/**
|
|
1932
|
+
* Disallows explicit type declarations for variables or
|
|
1933
|
+
* parameters initialized to a number, string, or boolean ✅ 🔧
|
|
1934
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-inferrable-types.md
|
|
1935
|
+
*/
|
|
1936
|
+
"@typescript-eslint/no-inferrable-types": "error",
|
|
1937
|
+
/**
|
|
1938
|
+
* Disallows usage of `void` type outside of generic or return types
|
|
1939
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-invalid-void-type.md
|
|
1940
|
+
*/
|
|
1941
|
+
"@typescript-eslint/no-invalid-void-type": "warn",
|
|
1942
|
+
/**
|
|
1943
|
+
* Disallow the `void` operator except when used to discard a value 🔧 💭
|
|
1944
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-meaningless-void-operator.md
|
|
1945
|
+
*/
|
|
1946
|
+
"@typescript-eslint/no-meaningless-void-operator": "error",
|
|
1947
|
+
/**
|
|
1948
|
+
* Enforce valid definition of `new` and `constructor` ✅
|
|
1949
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-misused-new.md
|
|
1950
|
+
*/
|
|
1951
|
+
"@typescript-eslint/no-misused-new": "error",
|
|
1952
|
+
/**
|
|
1953
|
+
* Avoid using promises in places not designed to handle them ✅ 💭
|
|
1954
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-misused-promises.md
|
|
1955
|
+
*/
|
|
1956
|
+
"@typescript-eslint/no-misused-promises": "error",
|
|
1957
|
+
/**
|
|
1958
|
+
* Disallow the use of custom TypeScript modules and namespaces ✅
|
|
1959
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-namespace.md
|
|
1960
|
+
*/
|
|
1961
|
+
"@typescript-eslint/no-namespace": "error",
|
|
1962
|
+
/**
|
|
1963
|
+
* Disallows using a non-null assertion in the left operand of the nullish coalescing operator
|
|
1964
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-non-null-asserted-nullish-coalescing.md
|
|
1965
|
+
*/
|
|
1966
|
+
"@typescript-eslint/no-non-null-asserted-nullish-coalescing": "error",
|
|
1967
|
+
/**
|
|
1968
|
+
* Disallows using a non-null assertion after an optional chain expression ✅
|
|
1969
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-non-null-asserted-optional-chain.md
|
|
1970
|
+
*/
|
|
1971
|
+
"@typescript-eslint/no-non-null-asserted-optional-chain": "error",
|
|
1972
|
+
/**
|
|
1973
|
+
* Disallows non-null assertions using the `!` postfix operator ✅
|
|
1974
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-non-null-assertion.md
|
|
1975
|
+
*/
|
|
1976
|
+
"@typescript-eslint/no-non-null-assertion": "error",
|
|
1977
|
+
/**
|
|
1978
|
+
* Disallows invocation of `require()`
|
|
1979
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-require-imports.md
|
|
1980
|
+
*/
|
|
1981
|
+
"@typescript-eslint/no-require-imports": "error",
|
|
1982
|
+
/**
|
|
1983
|
+
* Disallow aliasing `this` ✅
|
|
1984
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-this-alias.md
|
|
1985
|
+
*/
|
|
1986
|
+
"@typescript-eslint/no-this-alias": "error",
|
|
1987
|
+
/**
|
|
1988
|
+
* Disallow the use of type aliases
|
|
1989
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-type-alias.md
|
|
1990
|
+
*/
|
|
1991
|
+
"@typescript-eslint/no-type-alias": "off",
|
|
1992
|
+
/**
|
|
1993
|
+
* Flags unnecessary equality comparisons against boolean literals 🔧 💭
|
|
1994
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-unnecessary-boolean-literal-compare.md
|
|
1995
|
+
*/
|
|
1996
|
+
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "error",
|
|
1997
|
+
/**
|
|
1998
|
+
* Prevents conditionals where the type is always truthy or always falsy 🔧 💭
|
|
1999
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-unnecessary-condition.md
|
|
2000
|
+
*/
|
|
2001
|
+
"@typescript-eslint/no-unnecessary-condition": "error",
|
|
2002
|
+
/**
|
|
2003
|
+
* Warns when a namespace qualifier is unnecessary 🔧 💭
|
|
2004
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-unnecessary-qualifier.md
|
|
2005
|
+
*/
|
|
2006
|
+
"@typescript-eslint/no-unnecessary-qualifier": "warn",
|
|
2007
|
+
/**
|
|
2008
|
+
* Enforces that type arguments will not be used if not required 🔧 💭
|
|
2009
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-unnecessary-type-arguments.md
|
|
2010
|
+
*/
|
|
2011
|
+
"@typescript-eslint/no-unnecessary-type-arguments": "error",
|
|
2012
|
+
/**
|
|
2013
|
+
* Warns if a type assertion does not change the type of an expression ✅ 🔧 💭
|
|
2014
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-unnecessary-type-assertion.md
|
|
2015
|
+
*/
|
|
2016
|
+
"@typescript-eslint/no-unnecessary-type-assertion": "error",
|
|
2017
|
+
/**
|
|
2018
|
+
* Disallows unnecessary constraints on generic types 🔧
|
|
2019
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-unnecessary-type-constraint.md
|
|
2020
|
+
*/
|
|
2021
|
+
"@typescript-eslint/no-unnecessary-type-constraint": "error",
|
|
2022
|
+
/**
|
|
2023
|
+
* Disallows calling an function with an `any` type value 💭
|
|
2024
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-unsafe-argument.md
|
|
2025
|
+
*/
|
|
2026
|
+
"@typescript-eslint/no-unsafe-argument": "error",
|
|
2027
|
+
/**
|
|
2028
|
+
* Disallows assigning `any` to variables and properties ✅ 💭
|
|
2029
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-unsafe-assignment.md
|
|
2030
|
+
*/
|
|
2031
|
+
"@typescript-eslint/no-unsafe-assignment": "error",
|
|
2032
|
+
/**
|
|
2033
|
+
* Disallows calling an `any` type value ✅ 💭
|
|
2034
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-unsafe-call.md
|
|
2035
|
+
*/
|
|
2036
|
+
"@typescript-eslint/no-unsafe-call": "error",
|
|
2037
|
+
/**
|
|
2038
|
+
* Disallows member access on `any` typed variables ✅ 💭
|
|
2039
|
+
*/
|
|
2040
|
+
"@typescript-eslint/no-unsafe-function-type": "error",
|
|
2041
|
+
/**
|
|
2042
|
+
* Disallows member access on `any` typed variables ✅ 💭
|
|
2043
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-unsafe-member-access.md
|
|
2044
|
+
*/
|
|
2045
|
+
"@typescript-eslint/no-unsafe-member-access": "error",
|
|
2046
|
+
/**
|
|
2047
|
+
* Disallows returning any from a function ✅ 💭
|
|
2048
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-unsafe-return.md
|
|
2049
|
+
*/
|
|
2050
|
+
"@typescript-eslint/no-unsafe-return": "error",
|
|
2051
|
+
/**
|
|
2052
|
+
* Disallows the use of require statements except in import statements ✅
|
|
2053
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-var-requires.md
|
|
2054
|
+
*/
|
|
2055
|
+
"@typescript-eslint/no-var-requires": "error",
|
|
2056
|
+
/**
|
|
2057
|
+
* Disallow using confusing built-in primitive class wrappers.
|
|
2058
|
+
*/
|
|
2059
|
+
"@typescript-eslint/no-wrapper-object-types": "error",
|
|
2060
|
+
/**
|
|
2061
|
+
* Prefers a non-null assertion over explicit type cast when possible 🔧 💭
|
|
2062
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/non-nullable-type-assertion-style.md
|
|
2063
|
+
* Disabled because it enforces use of postfix ! operator, which is banned by
|
|
2064
|
+
* @typescript-eslint/no-non-null-assertion (a recommended rule)
|
|
2065
|
+
*/
|
|
2066
|
+
"@typescript-eslint/non-nullable-type-assertion-style": "off",
|
|
2067
|
+
/**
|
|
2068
|
+
* Prefer usage of as const over literal type ✅ 🔧
|
|
2069
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/prefer-as-const.md
|
|
2070
|
+
*/
|
|
2071
|
+
"@typescript-eslint/prefer-as-const": "error",
|
|
2072
|
+
/**
|
|
2073
|
+
* Prefer initializing each enums member value
|
|
2074
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/prefer-enum-initializers.md
|
|
2075
|
+
*/
|
|
2076
|
+
"@typescript-eslint/prefer-enum-initializers": "error",
|
|
2077
|
+
/**
|
|
2078
|
+
* Prefer a ‘for-of’ loop over a standard ‘for’ loop if the
|
|
2079
|
+
* index is only used to access the array being iterated
|
|
2080
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/prefer-for-of.md
|
|
2081
|
+
*/
|
|
2082
|
+
"@typescript-eslint/prefer-for-of": "error",
|
|
2083
|
+
/**
|
|
2084
|
+
* Use function types instead of interfaces with call signatures 🔧
|
|
2085
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/prefer-function-type.md
|
|
2086
|
+
*/
|
|
2087
|
+
"@typescript-eslint/prefer-function-type": "error",
|
|
2088
|
+
/**
|
|
2089
|
+
* Enforce includes method over indexOf method 🔧 💭
|
|
2090
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/prefer-includes.md
|
|
2091
|
+
*/
|
|
2092
|
+
"@typescript-eslint/prefer-includes": "error",
|
|
2093
|
+
/**
|
|
2094
|
+
* Require that all enum members be literal values to
|
|
2095
|
+
* prevent unintended enum member name shadow issues
|
|
2096
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/prefer-literal-enum-member.md
|
|
2097
|
+
*/
|
|
2098
|
+
"@typescript-eslint/prefer-literal-enum-member": "error",
|
|
2099
|
+
/**
|
|
2100
|
+
* Require the use of the `namespace` keyword instead of the
|
|
2101
|
+
* `module` keyword to declare custom TypeScript modules ✅ 🔧
|
|
2102
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/prefer-namespace-keyword.md
|
|
2103
|
+
*/
|
|
2104
|
+
"@typescript-eslint/prefer-namespace-keyword": "error",
|
|
2105
|
+
/**
|
|
2106
|
+
* Enforce the usage of the nullish coalescing operator instead of logical chaining 💭
|
|
2107
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/prefer-nullish-coalescing.md
|
|
2108
|
+
*/
|
|
2109
|
+
"@typescript-eslint/prefer-nullish-coalescing": "error",
|
|
2110
|
+
/**
|
|
2111
|
+
* Prefer using concise optional chain expressions instead of chained logical ands
|
|
2112
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/prefer-optional-chain.md
|
|
2113
|
+
*/
|
|
2114
|
+
"@typescript-eslint/prefer-optional-chain": "error",
|
|
2115
|
+
/**
|
|
2116
|
+
* Requires that private members are marked as `readonly` if
|
|
2117
|
+
* they're never modified outside of the constructor 🔧 💭
|
|
2118
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/prefer-readonly.md
|
|
2119
|
+
*/
|
|
2120
|
+
"@typescript-eslint/prefer-readonly": "error",
|
|
2121
|
+
/**
|
|
2122
|
+
* Requires that function parameters are typed as `readonly`
|
|
2123
|
+
* to prevent accidental mutation of inputs 💭
|
|
2124
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/prefer-readonly-parameter-types.md
|
|
2125
|
+
*/
|
|
2126
|
+
"@typescript-eslint/prefer-readonly-parameter-types": "off",
|
|
2127
|
+
/**
|
|
2128
|
+
* Prefer using type parameter when calling `Array#reduce` instead of casting 🔧 💭
|
|
2129
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/prefer-reduce-type-parameter.md
|
|
2130
|
+
*/
|
|
2131
|
+
"@typescript-eslint/prefer-reduce-type-parameter": "error",
|
|
2132
|
+
/**
|
|
2133
|
+
* Enforce that `RegExp#exec` is used instead of `String#match`
|
|
2134
|
+
* if no global flag is provided ✅ 🔧 💭
|
|
2135
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/prefer-regexp-exec.md
|
|
2136
|
+
*/
|
|
2137
|
+
"@typescript-eslint/prefer-regexp-exec": "error",
|
|
2138
|
+
/**
|
|
2139
|
+
* Enforce that `this` is used when only `this` type is returned 🔧 💭
|
|
2140
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/prefer-return-this-type.md
|
|
2141
|
+
*/
|
|
2142
|
+
"@typescript-eslint/prefer-return-this-type": "error",
|
|
2143
|
+
/**
|
|
2144
|
+
* Enforce the use of `String#startsWith` and `String#endsWith` instead
|
|
2145
|
+
* of other equivalent methods of checking substrings 🔧 💭
|
|
2146
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/prefer-string-starts-ends-with.md
|
|
2147
|
+
*/
|
|
2148
|
+
"@typescript-eslint/prefer-string-starts-ends-with": "error",
|
|
2149
|
+
/**
|
|
2150
|
+
* Recommends using `@ts-expect-error` over `@ts-ignore` 🔧
|
|
2151
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/prefer-ts-expect-error.md
|
|
2152
|
+
*/
|
|
2153
|
+
"@typescript-eslint/prefer-ts-expect-error": "error",
|
|
2154
|
+
/**
|
|
2155
|
+
* Requires any function or method that returns a Promise to be marked async 🔧 💭
|
|
2156
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/promise-function-async.md
|
|
2157
|
+
*/
|
|
2158
|
+
"@typescript-eslint/promise-function-async": "off",
|
|
2159
|
+
/**
|
|
2160
|
+
* Requires `Array#sort` calls to always provide a `compareFunction` 💭
|
|
2161
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/require-array-sort-compare.md
|
|
2162
|
+
*/
|
|
2163
|
+
"@typescript-eslint/require-array-sort-compare": "error",
|
|
2164
|
+
/**
|
|
2165
|
+
* When adding two variables, operands must both be of type number or of type string ✅ 💭
|
|
2166
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/restrict-plus-operands.md
|
|
2167
|
+
*/
|
|
2168
|
+
"@typescript-eslint/restrict-plus-operands": "error",
|
|
2169
|
+
/**
|
|
2170
|
+
* Enforce template literal expressions to be of string type ✅ 💭
|
|
2171
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/restrict-template-expressions.md
|
|
2172
|
+
*/
|
|
2173
|
+
"@typescript-eslint/restrict-template-expressions": "error",
|
|
2174
|
+
/**
|
|
2175
|
+
* Restricts the types allowed in boolean expressions 🔧 💭
|
|
2176
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/strict-boolean-expressions.md
|
|
2177
|
+
*/
|
|
2178
|
+
"@typescript-eslint/strict-boolean-expressions": "error",
|
|
2179
|
+
/**
|
|
2180
|
+
* Exhaustiveness checking in switch with union type 💭
|
|
2181
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/switch-exhaustiveness-check.md
|
|
2182
|
+
*/
|
|
2183
|
+
"@typescript-eslint/switch-exhaustiveness-check": "error",
|
|
2184
|
+
/**
|
|
2185
|
+
* Sets preference level for triple slash directives versus ES6-style import declarations ✅
|
|
2186
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/triple-slash-reference.md
|
|
2187
|
+
*/
|
|
2188
|
+
"@typescript-eslint/triple-slash-reference": "error",
|
|
2189
|
+
/**
|
|
2190
|
+
* Require consistent spacing around type annotations 🔧
|
|
2191
|
+
* https://eslint.style/rules/default/type-annotation-spacing#ts-type-annotation-spacing
|
|
2192
|
+
*/
|
|
2193
|
+
"@stylistic/type-annotation-spacing": "error",
|
|
2194
|
+
/**
|
|
2195
|
+
* Requires type annotations to exist
|
|
2196
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/typedef.md
|
|
2197
|
+
*/
|
|
2198
|
+
"@typescript-eslint/typedef": "off",
|
|
2199
|
+
/**
|
|
2200
|
+
* Enforces unbound methods are called with their expected scope ✅ 💭
|
|
2201
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/unbound-method.md
|
|
2202
|
+
*/
|
|
2203
|
+
"@typescript-eslint/unbound-method": ["error", { ignoreStatic: !0 }],
|
|
2204
|
+
/**
|
|
2205
|
+
* Warns for any two overloads that could be unified into
|
|
2206
|
+
* one by using a union or an optional/rest parameter
|
|
2207
|
+
* https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/unified-signatures.md
|
|
2208
|
+
*/
|
|
2209
|
+
"@typescript-eslint/unified-signatures": "warn"
|
|
2210
|
+
}, w = [
|
|
2211
|
+
// Production TypeScript files
|
|
2212
|
+
{
|
|
2213
|
+
files: ["**/*.ts", "**/*.tsx"],
|
|
2214
|
+
ignores: ["**/*.spec.ts", "**/*.spec.tsx", "**/*.test.ts", "**/*.test.tsx"],
|
|
2215
|
+
languageOptions: {
|
|
2216
|
+
parser: e,
|
|
2217
|
+
parserOptions: {
|
|
2218
|
+
// Note: For type-aware linting rules to work, you must configure
|
|
2219
|
+
// the 'project' option in your own config to point to your tsconfig.
|
|
2220
|
+
// Example: project: "./tsconfig.json" or project: true (auto-detect)
|
|
2221
|
+
},
|
|
2222
|
+
globals: {
|
|
2223
|
+
// Browser globals
|
|
2224
|
+
window: "readonly",
|
|
2225
|
+
document: "readonly",
|
|
2226
|
+
navigator: "readonly",
|
|
2227
|
+
console: "readonly",
|
|
2228
|
+
setTimeout: "readonly",
|
|
2229
|
+
clearTimeout: "readonly",
|
|
2230
|
+
setInterval: "readonly",
|
|
2231
|
+
clearInterval: "readonly"
|
|
2232
|
+
}
|
|
2233
|
+
},
|
|
2234
|
+
settings: {
|
|
2235
|
+
"import/extensions": [".ts", ".tsx"],
|
|
2236
|
+
"import/parsers": {
|
|
2237
|
+
"@typescript-eslint/parser": [".ts", ".tsx"]
|
|
2238
|
+
},
|
|
2239
|
+
"import/resolver": {
|
|
2240
|
+
typescript: {}
|
|
2241
|
+
}
|
|
2242
|
+
},
|
|
2243
|
+
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
2244
|
+
/* eslint-disable import/no-named-as-default-member */
|
|
2245
|
+
/* eslint-disable max-len */
|
|
2246
|
+
plugins: {
|
|
2247
|
+
"@typescript-eslint": r,
|
|
2248
|
+
import: o,
|
|
2249
|
+
"@stylistic": t
|
|
2250
|
+
},
|
|
2251
|
+
/* eslint-enable max-len */
|
|
2252
|
+
/* eslint-enable import/no-named-as-default-member */
|
|
2253
|
+
/* eslint-enable @typescript-eslint/no-unsafe-assignment */
|
|
2254
|
+
rules: {
|
|
2255
|
+
...s,
|
|
2256
|
+
...n,
|
|
2257
|
+
...i,
|
|
2258
|
+
...a,
|
|
2259
|
+
...p,
|
|
2260
|
+
...l,
|
|
2261
|
+
...c,
|
|
2262
|
+
...f,
|
|
2263
|
+
...m,
|
|
2264
|
+
...y,
|
|
2265
|
+
...u
|
|
2266
|
+
}
|
|
2267
|
+
},
|
|
2268
|
+
// Test files - includes test framework globals
|
|
2269
|
+
{
|
|
2270
|
+
files: ["**/*.spec.ts", "**/*.spec.tsx", "**/*.test.ts", "**/*.test.tsx"],
|
|
2271
|
+
languageOptions: {
|
|
2272
|
+
parser: e,
|
|
2273
|
+
parserOptions: {
|
|
2274
|
+
// Note: For type-aware linting rules to work, you must configure
|
|
2275
|
+
// the 'project' option in your own config to point to your tsconfig.
|
|
2276
|
+
// Example: project: "./tsconfig.json" or project: true (auto-detect)
|
|
2277
|
+
},
|
|
2278
|
+
globals: {
|
|
2279
|
+
// Browser globals
|
|
2280
|
+
window: "readonly",
|
|
2281
|
+
document: "readonly",
|
|
2282
|
+
navigator: "readonly",
|
|
2283
|
+
console: "readonly",
|
|
2284
|
+
setTimeout: "readonly",
|
|
2285
|
+
clearTimeout: "readonly",
|
|
2286
|
+
setInterval: "readonly",
|
|
2287
|
+
clearInterval: "readonly",
|
|
2288
|
+
// Jest/Vitest test globals
|
|
2289
|
+
describe: "readonly",
|
|
2290
|
+
test: "readonly",
|
|
2291
|
+
it: "readonly",
|
|
2292
|
+
expect: "readonly",
|
|
2293
|
+
beforeEach: "readonly",
|
|
2294
|
+
afterEach: "readonly",
|
|
2295
|
+
beforeAll: "readonly",
|
|
2296
|
+
afterAll: "readonly",
|
|
2297
|
+
vi: "readonly",
|
|
2298
|
+
jest: "readonly"
|
|
2299
|
+
}
|
|
2300
|
+
},
|
|
2301
|
+
settings: {
|
|
2302
|
+
"import/extensions": [".ts", ".tsx"],
|
|
2303
|
+
"import/parsers": {
|
|
2304
|
+
"@typescript-eslint/parser": [".ts", ".tsx"]
|
|
2305
|
+
},
|
|
2306
|
+
"import/resolver": {
|
|
2307
|
+
typescript: {
|
|
2308
|
+
alwaysTryTypes: !0
|
|
2309
|
+
}
|
|
2310
|
+
}
|
|
2311
|
+
},
|
|
2312
|
+
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
2313
|
+
plugins: {
|
|
2314
|
+
import: o,
|
|
2315
|
+
"@stylistic": t,
|
|
2316
|
+
"@typescript-eslint": r
|
|
2317
|
+
},
|
|
2318
|
+
/* eslint-enable @typescript-eslint/no-unsafe-assignment */
|
|
2319
|
+
rules: {
|
|
2320
|
+
...s,
|
|
2321
|
+
...n,
|
|
2322
|
+
...i,
|
|
2323
|
+
...a,
|
|
2324
|
+
...p,
|
|
2325
|
+
...l,
|
|
2326
|
+
...c,
|
|
2327
|
+
...f,
|
|
2328
|
+
...m,
|
|
2329
|
+
...y,
|
|
2330
|
+
...u
|
|
2331
|
+
}
|
|
2332
|
+
}
|
|
2333
|
+
];
|
|
2334
|
+
export {
|
|
2335
|
+
w as default
|
|
2336
|
+
};
|