@homer0/oxlint-config 0.2.0
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/README.md +158 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/docs/rule-differences.md +336 -0
- package/package.json +61 -0
- package/src/consts.ts +20 -0
- package/src/createConfig.ts +265 -0
- package/src/createNextjsConfig.ts +18 -0
- package/src/fragments.ts +31 -0
- package/src/index.ts +28 -0
- package/src/rules/base.ts +1214 -0
- package/src/rules/browser.ts +1 -0
- package/src/rules/index.ts +10 -0
- package/src/rules/jsdoc.ts +86 -0
- package/src/rules/nextjs.ts +128 -0
- package/src/rules/node.ts +44 -0
- package/src/rules/react.ts +410 -0
- package/src/rules/tests.ts +20 -0
- package/src/rules/typeAware.ts +20 -0
- package/src/rules/typescript.ts +178 -0
- package/src/rules/vitest.ts +44 -0
- package/src/types.ts +109 -0
|
@@ -0,0 +1,1214 @@
|
|
|
1
|
+
const maxComplexity = 30;
|
|
2
|
+
|
|
3
|
+
export const base = {
|
|
4
|
+
/**
|
|
5
|
+
* Enforce `return` statements in callbacks of array methods.
|
|
6
|
+
*
|
|
7
|
+
* @see https://eslint.org/docs/latest/rules/array-callback-return
|
|
8
|
+
*/
|
|
9
|
+
'array-callback-return': [
|
|
10
|
+
'error',
|
|
11
|
+
{
|
|
12
|
+
allowImplicit: true,
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
/**
|
|
16
|
+
* Enforce the use of variables within the scope they are defined.
|
|
17
|
+
*
|
|
18
|
+
* @see https://eslint.org/docs/latest/rules/block-scoped-var
|
|
19
|
+
*/
|
|
20
|
+
'block-scoped-var': 'error',
|
|
21
|
+
/**
|
|
22
|
+
* Enforce a maximum cyclomatic complexity allowed in a program.
|
|
23
|
+
*
|
|
24
|
+
* @see https://eslint.org/docs/latest/rules/complexity
|
|
25
|
+
*/
|
|
26
|
+
complexity: ['warn', maxComplexity],
|
|
27
|
+
/**
|
|
28
|
+
* Require `return` statements to either always or never specify values.
|
|
29
|
+
*
|
|
30
|
+
* @see https://eslint.org/docs/latest/rules/consistent-return
|
|
31
|
+
*/
|
|
32
|
+
'consistent-return': 'error',
|
|
33
|
+
/**
|
|
34
|
+
* Enforce consistent brace style for all control statements.
|
|
35
|
+
*
|
|
36
|
+
* @see https://eslint.org/docs/latest/rules/curly
|
|
37
|
+
*/
|
|
38
|
+
curly: 'off',
|
|
39
|
+
/**
|
|
40
|
+
* Require `default` cases in `switch` statements.
|
|
41
|
+
*
|
|
42
|
+
* @see https://eslint.org/docs/latest/rules/default-case
|
|
43
|
+
*/
|
|
44
|
+
'default-case': [
|
|
45
|
+
'error',
|
|
46
|
+
{
|
|
47
|
+
commentPattern: '^no default$',
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
/**
|
|
51
|
+
* Enforce `default` clauses in `switch` statements to be last.
|
|
52
|
+
*
|
|
53
|
+
* @see https://eslint.org/docs/latest/rules/default-case-last
|
|
54
|
+
*/
|
|
55
|
+
'default-case-last': 'error',
|
|
56
|
+
/**
|
|
57
|
+
* Enforce default parameters to be last.
|
|
58
|
+
*
|
|
59
|
+
* @see https://eslint.org/docs/latest/rules/default-param-last
|
|
60
|
+
*/
|
|
61
|
+
'default-param-last': 'error',
|
|
62
|
+
/**
|
|
63
|
+
* Enforce dot notation whenever possible.
|
|
64
|
+
*
|
|
65
|
+
* @see https://eslint.org/docs/latest/rules/dot-notation
|
|
66
|
+
*/
|
|
67
|
+
'dot-notation': [
|
|
68
|
+
'error',
|
|
69
|
+
{
|
|
70
|
+
allowKeywords: true,
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
/**
|
|
74
|
+
* Require the use of `===` and `!==`
|
|
75
|
+
*
|
|
76
|
+
* @see https://eslint.org/docs/latest/rules/eqeqeq
|
|
77
|
+
*/
|
|
78
|
+
eqeqeq: [
|
|
79
|
+
'error',
|
|
80
|
+
'always',
|
|
81
|
+
{
|
|
82
|
+
null: 'ignore',
|
|
83
|
+
},
|
|
84
|
+
],
|
|
85
|
+
/**
|
|
86
|
+
* Require grouped accessor pairs in object literals and classes.
|
|
87
|
+
*
|
|
88
|
+
* @see https://eslint.org/docs/latest/rules/grouped-accessor-pairs
|
|
89
|
+
*/
|
|
90
|
+
'grouped-accessor-pairs': 'error',
|
|
91
|
+
/**
|
|
92
|
+
* Require `for-in` loops to include an `if` statement.
|
|
93
|
+
*
|
|
94
|
+
* @see https://eslint.org/docs/latest/rules/guard-for-in
|
|
95
|
+
*/
|
|
96
|
+
'guard-for-in': 'error',
|
|
97
|
+
/**
|
|
98
|
+
* Enforce a maximum number of classes per file.
|
|
99
|
+
*
|
|
100
|
+
* @see https://eslint.org/docs/latest/rules/max-classes-per-file
|
|
101
|
+
*/
|
|
102
|
+
'max-classes-per-file': ['error', 1],
|
|
103
|
+
/**
|
|
104
|
+
* Disallow the use of `alert`, `confirm`, and `prompt`
|
|
105
|
+
*
|
|
106
|
+
* @see https://eslint.org/docs/latest/rules/no-alert
|
|
107
|
+
*/
|
|
108
|
+
'no-alert': 'warn',
|
|
109
|
+
/**
|
|
110
|
+
* Disallow the use of `arguments.caller` or `arguments.callee`
|
|
111
|
+
*
|
|
112
|
+
* @see https://eslint.org/docs/latest/rules/no-caller
|
|
113
|
+
*/
|
|
114
|
+
'no-caller': 'error',
|
|
115
|
+
/**
|
|
116
|
+
* Disallow lexical declarations in case clauses.
|
|
117
|
+
*
|
|
118
|
+
* @see https://eslint.org/docs/latest/rules/no-case-declarations
|
|
119
|
+
*/
|
|
120
|
+
'no-case-declarations': 'error',
|
|
121
|
+
/**
|
|
122
|
+
* Disallow returning value from constructor.
|
|
123
|
+
*
|
|
124
|
+
* @see https://eslint.org/docs/latest/rules/no-constructor-return
|
|
125
|
+
*/
|
|
126
|
+
'no-constructor-return': 'error',
|
|
127
|
+
/**
|
|
128
|
+
* Disallow `else` blocks after `return` statements in `if` statements.
|
|
129
|
+
*
|
|
130
|
+
* @see https://eslint.org/docs/latest/rules/no-else-return
|
|
131
|
+
*/
|
|
132
|
+
'no-else-return': [
|
|
133
|
+
'error',
|
|
134
|
+
{
|
|
135
|
+
allowElseIf: false,
|
|
136
|
+
},
|
|
137
|
+
],
|
|
138
|
+
/**
|
|
139
|
+
* Disallow empty functions.
|
|
140
|
+
*
|
|
141
|
+
* @see https://eslint.org/docs/latest/rules/no-empty-function
|
|
142
|
+
*/
|
|
143
|
+
'no-empty-function': [
|
|
144
|
+
'error',
|
|
145
|
+
{
|
|
146
|
+
allow: ['arrowFunctions', 'functions', 'methods'],
|
|
147
|
+
},
|
|
148
|
+
],
|
|
149
|
+
/**
|
|
150
|
+
* Disallow empty destructuring patterns.
|
|
151
|
+
*
|
|
152
|
+
* @see https://eslint.org/docs/latest/rules/no-empty-pattern
|
|
153
|
+
*/
|
|
154
|
+
'no-empty-pattern': 'error',
|
|
155
|
+
/**
|
|
156
|
+
* Disallow the use of `eval()`
|
|
157
|
+
*
|
|
158
|
+
* @see https://eslint.org/docs/latest/rules/no-eval
|
|
159
|
+
*/
|
|
160
|
+
'no-eval': 'error',
|
|
161
|
+
/**
|
|
162
|
+
* Disallow extending native types.
|
|
163
|
+
*
|
|
164
|
+
* @see https://eslint.org/docs/latest/rules/no-extend-native
|
|
165
|
+
*/
|
|
166
|
+
'no-extend-native': 'error',
|
|
167
|
+
/**
|
|
168
|
+
* Disallow unnecessary calls to `.bind()`
|
|
169
|
+
*
|
|
170
|
+
* @see https://eslint.org/docs/latest/rules/no-extra-bind
|
|
171
|
+
*/
|
|
172
|
+
'no-extra-bind': 'error',
|
|
173
|
+
/**
|
|
174
|
+
* Disallow unnecessary labels.
|
|
175
|
+
*
|
|
176
|
+
* @see https://eslint.org/docs/latest/rules/no-extra-label
|
|
177
|
+
*/
|
|
178
|
+
'no-extra-label': 'error',
|
|
179
|
+
/**
|
|
180
|
+
* Disallow fallthrough of `case` statements.
|
|
181
|
+
*
|
|
182
|
+
* @see https://eslint.org/docs/latest/rules/no-fallthrough
|
|
183
|
+
*/
|
|
184
|
+
'no-fallthrough': 'error',
|
|
185
|
+
/**
|
|
186
|
+
* Disallow assignments to native objects or read-only global variables.
|
|
187
|
+
*
|
|
188
|
+
* @see https://eslint.org/docs/latest/rules/no-global-assign
|
|
189
|
+
*/
|
|
190
|
+
'no-global-assign': [
|
|
191
|
+
'error',
|
|
192
|
+
{
|
|
193
|
+
exceptions: [],
|
|
194
|
+
},
|
|
195
|
+
],
|
|
196
|
+
/**
|
|
197
|
+
* Disallow the use of `eval()`-like methods.
|
|
198
|
+
*
|
|
199
|
+
* @see https://eslint.org/docs/latest/rules/no-implied-eval
|
|
200
|
+
*/
|
|
201
|
+
'no-implied-eval': 'error',
|
|
202
|
+
/**
|
|
203
|
+
* Disallow the use of the `__iterator__` property.
|
|
204
|
+
*
|
|
205
|
+
* @see https://eslint.org/docs/latest/rules/no-iterator
|
|
206
|
+
*/
|
|
207
|
+
'no-iterator': 'error',
|
|
208
|
+
/**
|
|
209
|
+
* Disallow labeled statements.
|
|
210
|
+
*
|
|
211
|
+
* @see https://eslint.org/docs/latest/rules/no-labels
|
|
212
|
+
*/
|
|
213
|
+
'no-labels': [
|
|
214
|
+
'error',
|
|
215
|
+
{
|
|
216
|
+
allowLoop: false,
|
|
217
|
+
allowSwitch: false,
|
|
218
|
+
},
|
|
219
|
+
],
|
|
220
|
+
/**
|
|
221
|
+
* Disallow unnecessary nested blocks.
|
|
222
|
+
*
|
|
223
|
+
* @see https://eslint.org/docs/latest/rules/no-lone-blocks
|
|
224
|
+
*/
|
|
225
|
+
'no-lone-blocks': 'error',
|
|
226
|
+
/**
|
|
227
|
+
* Disallow function declarations that contain unsafe references inside loop statements.
|
|
228
|
+
*
|
|
229
|
+
* @see https://eslint.org/docs/latest/rules/no-loop-func
|
|
230
|
+
*/
|
|
231
|
+
'no-loop-func': 'error',
|
|
232
|
+
/**
|
|
233
|
+
* Disallow magic numbers.
|
|
234
|
+
*
|
|
235
|
+
* @see https://eslint.org/docs/latest/rules/no-magic-numbers
|
|
236
|
+
*/
|
|
237
|
+
'no-magic-numbers': [
|
|
238
|
+
'error',
|
|
239
|
+
{
|
|
240
|
+
ignore: [0, 1, -1, 60, 100, 1000],
|
|
241
|
+
ignoreArrayIndexes: true,
|
|
242
|
+
enforceConst: false,
|
|
243
|
+
detectObjects: false,
|
|
244
|
+
},
|
|
245
|
+
],
|
|
246
|
+
/**
|
|
247
|
+
* Disallow multiline strings.
|
|
248
|
+
*
|
|
249
|
+
* @see https://eslint.org/docs/latest/rules/no-multi-str
|
|
250
|
+
*/
|
|
251
|
+
'no-multi-str': 'error',
|
|
252
|
+
/**
|
|
253
|
+
* Disallow `new` operators outside of assignments or comparisons.
|
|
254
|
+
*
|
|
255
|
+
* @see https://eslint.org/docs/latest/rules/no-new
|
|
256
|
+
*/
|
|
257
|
+
'no-new': 'error',
|
|
258
|
+
/**
|
|
259
|
+
* Disallow `new` operators with the `Function` object.
|
|
260
|
+
*
|
|
261
|
+
* @see https://eslint.org/docs/latest/rules/no-new-func
|
|
262
|
+
*/
|
|
263
|
+
'no-new-func': 'error',
|
|
264
|
+
/**
|
|
265
|
+
* Disallow `new` operators with the `String`, `Number`, and `Boolean` objects.
|
|
266
|
+
*
|
|
267
|
+
* @see https://eslint.org/docs/latest/rules/no-new-wrappers
|
|
268
|
+
*/
|
|
269
|
+
'no-new-wrappers': 'error',
|
|
270
|
+
/**
|
|
271
|
+
* Disallow `\8` and `\9` escape sequences in string literals.
|
|
272
|
+
*
|
|
273
|
+
* @see https://eslint.org/docs/latest/rules/no-nonoctal-decimal-escape
|
|
274
|
+
*/
|
|
275
|
+
'no-nonoctal-decimal-escape': 'error',
|
|
276
|
+
/**
|
|
277
|
+
* Disallow reassigning function parameters.
|
|
278
|
+
*
|
|
279
|
+
* @see https://eslint.org/docs/latest/rules/no-param-reassign
|
|
280
|
+
*/
|
|
281
|
+
'no-param-reassign': [
|
|
282
|
+
'error',
|
|
283
|
+
{
|
|
284
|
+
props: true,
|
|
285
|
+
ignorePropertyModificationsFor: [
|
|
286
|
+
'acc',
|
|
287
|
+
'accumulator',
|
|
288
|
+
'e',
|
|
289
|
+
'ctx',
|
|
290
|
+
'context',
|
|
291
|
+
'req',
|
|
292
|
+
'request',
|
|
293
|
+
'res',
|
|
294
|
+
'response',
|
|
295
|
+
'$scope',
|
|
296
|
+
'staticContext',
|
|
297
|
+
'state',
|
|
298
|
+
'ref',
|
|
299
|
+
'sacc',
|
|
300
|
+
],
|
|
301
|
+
},
|
|
302
|
+
],
|
|
303
|
+
/**
|
|
304
|
+
* Disallow the use of the `__proto__` property.
|
|
305
|
+
*
|
|
306
|
+
* @see https://eslint.org/docs/latest/rules/no-proto
|
|
307
|
+
*/
|
|
308
|
+
'no-proto': 'error',
|
|
309
|
+
/**
|
|
310
|
+
* Disallow variable redeclaration.
|
|
311
|
+
*
|
|
312
|
+
* @see https://eslint.org/docs/latest/rules/no-redeclare
|
|
313
|
+
*/
|
|
314
|
+
'no-redeclare': 'error',
|
|
315
|
+
/**
|
|
316
|
+
* Disallow certain properties on certain objects.
|
|
317
|
+
*
|
|
318
|
+
* @see https://eslint.org/docs/latest/rules/no-restricted-properties
|
|
319
|
+
*/
|
|
320
|
+
'no-restricted-properties': [
|
|
321
|
+
'error',
|
|
322
|
+
{
|
|
323
|
+
object: 'arguments',
|
|
324
|
+
property: 'callee',
|
|
325
|
+
message: 'arguments.callee is deprecated',
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
object: 'global',
|
|
329
|
+
property: 'isFinite',
|
|
330
|
+
message: 'Please use Number.isFinite instead',
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
object: 'self',
|
|
334
|
+
property: 'isFinite',
|
|
335
|
+
message: 'Please use Number.isFinite instead',
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
object: 'window',
|
|
339
|
+
property: 'isFinite',
|
|
340
|
+
message: 'Please use Number.isFinite instead',
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
object: 'global',
|
|
344
|
+
property: 'isNaN',
|
|
345
|
+
message: 'Please use Number.isNaN instead',
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
object: 'self',
|
|
349
|
+
property: 'isNaN',
|
|
350
|
+
message: 'Please use Number.isNaN instead',
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
object: 'window',
|
|
354
|
+
property: 'isNaN',
|
|
355
|
+
message: 'Please use Number.isNaN instead',
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
property: '__defineGetter__',
|
|
359
|
+
message: 'Please use Object.defineProperty instead.',
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
property: '__defineSetter__',
|
|
363
|
+
message: 'Please use Object.defineProperty instead.',
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
object: 'Math',
|
|
367
|
+
property: 'pow',
|
|
368
|
+
message: 'Use the exponentiation operator (**) instead.',
|
|
369
|
+
},
|
|
370
|
+
],
|
|
371
|
+
/**
|
|
372
|
+
* Disallow assignment operators in `return` statements.
|
|
373
|
+
*
|
|
374
|
+
* @see https://eslint.org/docs/latest/rules/no-return-assign
|
|
375
|
+
*/
|
|
376
|
+
'no-return-assign': ['error', 'always'],
|
|
377
|
+
/**
|
|
378
|
+
* Disallow `javascript:` URLs.
|
|
379
|
+
*
|
|
380
|
+
* @see https://eslint.org/docs/latest/rules/no-script-url
|
|
381
|
+
*/
|
|
382
|
+
'no-script-url': 'error',
|
|
383
|
+
/**
|
|
384
|
+
* Disallow assignments where both sides are exactly the same.
|
|
385
|
+
*
|
|
386
|
+
* @see https://eslint.org/docs/latest/rules/no-self-assign
|
|
387
|
+
*/
|
|
388
|
+
'no-self-assign': [
|
|
389
|
+
'error',
|
|
390
|
+
{
|
|
391
|
+
props: true,
|
|
392
|
+
},
|
|
393
|
+
],
|
|
394
|
+
/**
|
|
395
|
+
* Disallow comparisons where both sides are exactly the same.
|
|
396
|
+
*
|
|
397
|
+
* @see https://eslint.org/docs/latest/rules/no-self-compare
|
|
398
|
+
*/
|
|
399
|
+
'no-self-compare': 'error',
|
|
400
|
+
/**
|
|
401
|
+
* Disallow comma operators.
|
|
402
|
+
*
|
|
403
|
+
* @see https://eslint.org/docs/latest/rules/no-sequences
|
|
404
|
+
*/
|
|
405
|
+
'no-sequences': 'error',
|
|
406
|
+
/**
|
|
407
|
+
* Disallow throwing literals as exceptions.
|
|
408
|
+
*
|
|
409
|
+
* @see https://eslint.org/docs/latest/rules/no-throw-literal
|
|
410
|
+
*/
|
|
411
|
+
'no-throw-literal': 'error',
|
|
412
|
+
/**
|
|
413
|
+
* Disallow unmodified loop conditions.
|
|
414
|
+
*
|
|
415
|
+
* @see https://eslint.org/docs/latest/rules/no-unmodified-loop-condition
|
|
416
|
+
*/
|
|
417
|
+
'no-unmodified-loop-condition': 'error',
|
|
418
|
+
/**
|
|
419
|
+
* Disallow unused expressions.
|
|
420
|
+
*
|
|
421
|
+
* @see https://eslint.org/docs/latest/rules/no-unused-expressions
|
|
422
|
+
*/
|
|
423
|
+
'no-unused-expressions': [
|
|
424
|
+
'error',
|
|
425
|
+
{
|
|
426
|
+
allowShortCircuit: false,
|
|
427
|
+
allowTernary: false,
|
|
428
|
+
allowTaggedTemplates: false,
|
|
429
|
+
},
|
|
430
|
+
],
|
|
431
|
+
/**
|
|
432
|
+
* Disallow unused labels.
|
|
433
|
+
*
|
|
434
|
+
* @see https://eslint.org/docs/latest/rules/no-unused-labels
|
|
435
|
+
*/
|
|
436
|
+
'no-unused-labels': 'error',
|
|
437
|
+
/**
|
|
438
|
+
* Disallow unnecessary calls to `.call()` and `.apply()`
|
|
439
|
+
*
|
|
440
|
+
* @see https://eslint.org/docs/latest/rules/no-useless-call
|
|
441
|
+
*/
|
|
442
|
+
'no-useless-call': 'error',
|
|
443
|
+
/**
|
|
444
|
+
* Disallow unnecessary `catch` clauses.
|
|
445
|
+
*
|
|
446
|
+
* @see https://eslint.org/docs/latest/rules/no-useless-catch
|
|
447
|
+
*/
|
|
448
|
+
'no-useless-catch': 'error',
|
|
449
|
+
/**
|
|
450
|
+
* Disallow unnecessary concatenation of literals or template literals.
|
|
451
|
+
*
|
|
452
|
+
* @see https://eslint.org/docs/latest/rules/no-useless-concat
|
|
453
|
+
*/
|
|
454
|
+
'no-useless-concat': 'error',
|
|
455
|
+
/**
|
|
456
|
+
* Disallow redundant return statements.
|
|
457
|
+
*
|
|
458
|
+
* @see https://eslint.org/docs/latest/rules/no-useless-return
|
|
459
|
+
*/
|
|
460
|
+
'no-useless-return': 'error',
|
|
461
|
+
/**
|
|
462
|
+
* Disallow `void` operators.
|
|
463
|
+
*
|
|
464
|
+
* @see https://eslint.org/docs/latest/rules/no-void
|
|
465
|
+
*/
|
|
466
|
+
'no-void': 'error',
|
|
467
|
+
/**
|
|
468
|
+
* Disallow `with` statements.
|
|
469
|
+
*
|
|
470
|
+
* @see https://eslint.org/docs/latest/rules/no-with
|
|
471
|
+
*/
|
|
472
|
+
'no-with': 'error',
|
|
473
|
+
/**
|
|
474
|
+
* Require using Error objects as Promise rejection reasons.
|
|
475
|
+
*
|
|
476
|
+
* @see https://eslint.org/docs/latest/rules/prefer-promise-reject-errors
|
|
477
|
+
*/
|
|
478
|
+
'prefer-promise-reject-errors': [
|
|
479
|
+
'error',
|
|
480
|
+
{
|
|
481
|
+
allowEmptyReject: true,
|
|
482
|
+
},
|
|
483
|
+
],
|
|
484
|
+
/**
|
|
485
|
+
* Disallow use of the `RegExp` constructor in favor of regular expression literals.
|
|
486
|
+
*
|
|
487
|
+
* @see https://eslint.org/docs/latest/rules/prefer-regex-literals
|
|
488
|
+
*/
|
|
489
|
+
'prefer-regex-literals': [
|
|
490
|
+
'error',
|
|
491
|
+
{
|
|
492
|
+
disallowRedundantWrapping: true,
|
|
493
|
+
},
|
|
494
|
+
],
|
|
495
|
+
/**
|
|
496
|
+
* Enforce the consistent use of the radix argument when using `parseInt()`
|
|
497
|
+
*
|
|
498
|
+
* @see https://eslint.org/docs/latest/rules/radix
|
|
499
|
+
*/
|
|
500
|
+
radix: 'error',
|
|
501
|
+
/**
|
|
502
|
+
* Require `var` declarations be placed at the top of their containing scope.
|
|
503
|
+
*
|
|
504
|
+
* @see https://eslint.org/docs/latest/rules/vars-on-top
|
|
505
|
+
*/
|
|
506
|
+
'vars-on-top': 'error',
|
|
507
|
+
/**
|
|
508
|
+
* Require or disallow "Yoda" conditions.
|
|
509
|
+
*
|
|
510
|
+
* @see https://eslint.org/docs/latest/rules/yoda
|
|
511
|
+
*/
|
|
512
|
+
yoda: 'error',
|
|
513
|
+
/**
|
|
514
|
+
* Enforce `for` loop update clause moving the counter in the right direction.
|
|
515
|
+
*
|
|
516
|
+
* @see https://eslint.org/docs/latest/rules/for-direction
|
|
517
|
+
*/
|
|
518
|
+
'for-direction': 'error',
|
|
519
|
+
/**
|
|
520
|
+
* Enforce `return` statements in getters.
|
|
521
|
+
*
|
|
522
|
+
* @see https://eslint.org/docs/latest/rules/getter-return
|
|
523
|
+
*/
|
|
524
|
+
'getter-return': [
|
|
525
|
+
'error',
|
|
526
|
+
{
|
|
527
|
+
allowImplicit: true,
|
|
528
|
+
},
|
|
529
|
+
],
|
|
530
|
+
/**
|
|
531
|
+
* Disallow using an async function as a Promise executor.
|
|
532
|
+
*
|
|
533
|
+
* @see https://eslint.org/docs/latest/rules/no-async-promise-executor
|
|
534
|
+
*/
|
|
535
|
+
'no-async-promise-executor': 'error',
|
|
536
|
+
/**
|
|
537
|
+
* Disallow comparing against `-0`
|
|
538
|
+
*
|
|
539
|
+
* @see https://eslint.org/docs/latest/rules/no-compare-neg-zero
|
|
540
|
+
*/
|
|
541
|
+
'no-compare-neg-zero': 'error',
|
|
542
|
+
/**
|
|
543
|
+
* Disallow assignment operators in conditional expressions.
|
|
544
|
+
*
|
|
545
|
+
* @see https://eslint.org/docs/latest/rules/no-cond-assign
|
|
546
|
+
*/
|
|
547
|
+
'no-cond-assign': ['error', 'always'],
|
|
548
|
+
/**
|
|
549
|
+
* Disallow the use of `console`
|
|
550
|
+
*
|
|
551
|
+
* @see https://eslint.org/docs/latest/rules/no-console
|
|
552
|
+
*/
|
|
553
|
+
'no-console': 'warn',
|
|
554
|
+
/**
|
|
555
|
+
* Disallow control characters in regular expressions.
|
|
556
|
+
*
|
|
557
|
+
* @see https://eslint.org/docs/latest/rules/no-control-regex
|
|
558
|
+
*/
|
|
559
|
+
'no-control-regex': 'error',
|
|
560
|
+
/**
|
|
561
|
+
* Disallow the use of `debugger`
|
|
562
|
+
*
|
|
563
|
+
* @see https://eslint.org/docs/latest/rules/no-debugger
|
|
564
|
+
*/
|
|
565
|
+
'no-debugger': 'error',
|
|
566
|
+
/**
|
|
567
|
+
* Disallow duplicate conditions in if-else-if chains.
|
|
568
|
+
*
|
|
569
|
+
* @see https://eslint.org/docs/latest/rules/no-dupe-else-if
|
|
570
|
+
*/
|
|
571
|
+
'no-dupe-else-if': 'error',
|
|
572
|
+
/**
|
|
573
|
+
* Disallow duplicate keys in object literals.
|
|
574
|
+
*
|
|
575
|
+
* @see https://eslint.org/docs/latest/rules/no-dupe-keys
|
|
576
|
+
*/
|
|
577
|
+
'no-dupe-keys': 'error',
|
|
578
|
+
/**
|
|
579
|
+
* Disallow duplicate case labels.
|
|
580
|
+
*
|
|
581
|
+
* @see https://eslint.org/docs/latest/rules/no-duplicate-case
|
|
582
|
+
*/
|
|
583
|
+
'no-duplicate-case': 'error',
|
|
584
|
+
/**
|
|
585
|
+
* Disallow empty block statements.
|
|
586
|
+
*
|
|
587
|
+
* @see https://eslint.org/docs/latest/rules/no-empty
|
|
588
|
+
*/
|
|
589
|
+
'no-empty': 'error',
|
|
590
|
+
/**
|
|
591
|
+
* Disallow empty character classes in regular expressions.
|
|
592
|
+
*
|
|
593
|
+
* @see https://eslint.org/docs/latest/rules/no-empty-character-class
|
|
594
|
+
*/
|
|
595
|
+
'no-empty-character-class': 'error',
|
|
596
|
+
/**
|
|
597
|
+
* Disallow reassigning exceptions in `catch` clauses.
|
|
598
|
+
*
|
|
599
|
+
* @see https://eslint.org/docs/latest/rules/no-ex-assign
|
|
600
|
+
*/
|
|
601
|
+
'no-ex-assign': 'error',
|
|
602
|
+
/**
|
|
603
|
+
* Disallow unnecessary boolean casts.
|
|
604
|
+
*
|
|
605
|
+
* @see https://eslint.org/docs/latest/rules/no-extra-boolean-cast
|
|
606
|
+
*/
|
|
607
|
+
'no-extra-boolean-cast': 'error',
|
|
608
|
+
/**
|
|
609
|
+
* Disallow reassigning `function` declarations.
|
|
610
|
+
*
|
|
611
|
+
* @see https://eslint.org/docs/latest/rules/no-func-assign
|
|
612
|
+
*/
|
|
613
|
+
'no-func-assign': 'error',
|
|
614
|
+
/**
|
|
615
|
+
* Disallow assigning to imported bindings.
|
|
616
|
+
*
|
|
617
|
+
* @see https://eslint.org/docs/latest/rules/no-import-assign
|
|
618
|
+
*/
|
|
619
|
+
'no-import-assign': 'error',
|
|
620
|
+
/**
|
|
621
|
+
* Disallow variable or `function` declarations in nested blocks.
|
|
622
|
+
*
|
|
623
|
+
* @see https://eslint.org/docs/latest/rules/no-inner-declarations
|
|
624
|
+
*/
|
|
625
|
+
'no-inner-declarations': 'error',
|
|
626
|
+
/**
|
|
627
|
+
* Disallow invalid regular expression strings in `RegExp` constructors.
|
|
628
|
+
*
|
|
629
|
+
* @see https://eslint.org/docs/latest/rules/no-invalid-regexp
|
|
630
|
+
*/
|
|
631
|
+
'no-invalid-regexp': 'error',
|
|
632
|
+
/**
|
|
633
|
+
* Disallow irregular whitespace.
|
|
634
|
+
*
|
|
635
|
+
* @see https://eslint.org/docs/latest/rules/no-irregular-whitespace
|
|
636
|
+
*/
|
|
637
|
+
'no-irregular-whitespace': 'error',
|
|
638
|
+
/**
|
|
639
|
+
* Disallow literal numbers that lose precision.
|
|
640
|
+
*
|
|
641
|
+
* @see https://eslint.org/docs/latest/rules/no-loss-of-precision
|
|
642
|
+
*/
|
|
643
|
+
'no-loss-of-precision': 'error',
|
|
644
|
+
/**
|
|
645
|
+
* Disallow characters which are made with multiple code points in character class
|
|
646
|
+
* syntax.
|
|
647
|
+
*
|
|
648
|
+
* @see https://eslint.org/docs/latest/rules/no-misleading-character-class
|
|
649
|
+
*/
|
|
650
|
+
'no-misleading-character-class': 'error',
|
|
651
|
+
/**
|
|
652
|
+
* Disallow calling global object properties as functions.
|
|
653
|
+
*
|
|
654
|
+
* @see https://eslint.org/docs/latest/rules/no-obj-calls
|
|
655
|
+
*/
|
|
656
|
+
'no-obj-calls': 'error',
|
|
657
|
+
/**
|
|
658
|
+
* Disallow returning values from Promise executor functions.
|
|
659
|
+
*
|
|
660
|
+
* @see https://eslint.org/docs/latest/rules/no-promise-executor-return
|
|
661
|
+
*/
|
|
662
|
+
'no-promise-executor-return': 'error',
|
|
663
|
+
/**
|
|
664
|
+
* Disallow calling some `Object.prototype` methods directly on objects.
|
|
665
|
+
*
|
|
666
|
+
* @see https://eslint.org/docs/latest/rules/no-prototype-builtins
|
|
667
|
+
*/
|
|
668
|
+
'no-prototype-builtins': 'error',
|
|
669
|
+
/**
|
|
670
|
+
* Disallow multiple spaces in regular expressions.
|
|
671
|
+
*
|
|
672
|
+
* @see https://eslint.org/docs/latest/rules/no-regex-spaces
|
|
673
|
+
*/
|
|
674
|
+
'no-regex-spaces': 'error',
|
|
675
|
+
/**
|
|
676
|
+
* Disallow returning values from setters.
|
|
677
|
+
*
|
|
678
|
+
* @see https://eslint.org/docs/latest/rules/no-setter-return
|
|
679
|
+
*/
|
|
680
|
+
'no-setter-return': 'error',
|
|
681
|
+
/**
|
|
682
|
+
* Disallow sparse arrays.
|
|
683
|
+
*
|
|
684
|
+
* @see https://eslint.org/docs/latest/rules/no-sparse-arrays
|
|
685
|
+
*/
|
|
686
|
+
'no-sparse-arrays': 'error',
|
|
687
|
+
/**
|
|
688
|
+
* Disallow template literal placeholder syntax in regular strings.
|
|
689
|
+
*
|
|
690
|
+
* @see https://eslint.org/docs/latest/rules/no-template-curly-in-string
|
|
691
|
+
*/
|
|
692
|
+
'no-template-curly-in-string': 'error',
|
|
693
|
+
/**
|
|
694
|
+
* Disallow confusing multiline expressions.
|
|
695
|
+
*
|
|
696
|
+
* @see https://eslint.org/docs/latest/rules/no-unexpected-multiline
|
|
697
|
+
*/
|
|
698
|
+
'no-unexpected-multiline': 'off',
|
|
699
|
+
/**
|
|
700
|
+
* Disallow unreachable code after `return`, `throw`, `continue`, and `break`
|
|
701
|
+
* statements.
|
|
702
|
+
*
|
|
703
|
+
* @see https://eslint.org/docs/latest/rules/no-unreachable
|
|
704
|
+
*/
|
|
705
|
+
'no-unreachable': 'error',
|
|
706
|
+
/**
|
|
707
|
+
* Disallow loops with a body that allows only one iteration.
|
|
708
|
+
*
|
|
709
|
+
* @see https://eslint.org/docs/latest/rules/no-unreachable-loop
|
|
710
|
+
*/
|
|
711
|
+
'no-unreachable-loop': [
|
|
712
|
+
'error',
|
|
713
|
+
{
|
|
714
|
+
ignore: [],
|
|
715
|
+
},
|
|
716
|
+
],
|
|
717
|
+
/**
|
|
718
|
+
* Disallow control flow statements in `finally` blocks.
|
|
719
|
+
*
|
|
720
|
+
* @see https://eslint.org/docs/latest/rules/no-unsafe-finally
|
|
721
|
+
*/
|
|
722
|
+
'no-unsafe-finally': 'error',
|
|
723
|
+
/**
|
|
724
|
+
* Disallow negating the left operand of relational operators.
|
|
725
|
+
*
|
|
726
|
+
* @see https://eslint.org/docs/latest/rules/no-unsafe-negation
|
|
727
|
+
*/
|
|
728
|
+
'no-unsafe-negation': 'error',
|
|
729
|
+
/**
|
|
730
|
+
* Disallow use of optional chaining in contexts where the `undefined` value is not
|
|
731
|
+
* allowed.
|
|
732
|
+
*
|
|
733
|
+
* @see https://eslint.org/docs/latest/rules/no-unsafe-optional-chaining
|
|
734
|
+
*/
|
|
735
|
+
'no-unsafe-optional-chaining': [
|
|
736
|
+
'error',
|
|
737
|
+
{
|
|
738
|
+
disallowArithmeticOperators: true,
|
|
739
|
+
},
|
|
740
|
+
],
|
|
741
|
+
/**
|
|
742
|
+
* Disallow useless backreferences in regular expressions.
|
|
743
|
+
*
|
|
744
|
+
* @see https://eslint.org/docs/latest/rules/no-useless-backreference
|
|
745
|
+
*/
|
|
746
|
+
'no-useless-backreference': 'error',
|
|
747
|
+
/**
|
|
748
|
+
* Require calls to `isNaN()` when checking for `NaN`
|
|
749
|
+
*
|
|
750
|
+
* @see https://eslint.org/docs/latest/rules/use-isnan
|
|
751
|
+
*/
|
|
752
|
+
'use-isnan': 'error',
|
|
753
|
+
/**
|
|
754
|
+
* Enforce comparing `typeof` expressions against valid strings.
|
|
755
|
+
*
|
|
756
|
+
* @see https://eslint.org/docs/latest/rules/valid-typeof
|
|
757
|
+
*/
|
|
758
|
+
'valid-typeof': [
|
|
759
|
+
'error',
|
|
760
|
+
{
|
|
761
|
+
requireStringLiterals: true,
|
|
762
|
+
},
|
|
763
|
+
],
|
|
764
|
+
/**
|
|
765
|
+
* Require or disallow named `function` expressions.
|
|
766
|
+
*
|
|
767
|
+
* @see https://eslint.org/docs/latest/rules/func-names
|
|
768
|
+
*/
|
|
769
|
+
'func-names': 'warn',
|
|
770
|
+
/**
|
|
771
|
+
* Require constructor names to begin with a capital letter.
|
|
772
|
+
*
|
|
773
|
+
* @see https://eslint.org/docs/latest/rules/new-cap
|
|
774
|
+
*/
|
|
775
|
+
'new-cap': [
|
|
776
|
+
'error',
|
|
777
|
+
{
|
|
778
|
+
newIsCap: true,
|
|
779
|
+
newIsCapExceptions: [],
|
|
780
|
+
capIsNew: false,
|
|
781
|
+
capIsNewExceptions: ['Immutable.Map', 'Immutable.Set', 'Immutable.List'],
|
|
782
|
+
},
|
|
783
|
+
],
|
|
784
|
+
/**
|
|
785
|
+
* Disallow `Array` constructors.
|
|
786
|
+
*
|
|
787
|
+
* @see https://eslint.org/docs/latest/rules/no-array-constructor
|
|
788
|
+
*/
|
|
789
|
+
'no-array-constructor': 'error',
|
|
790
|
+
/**
|
|
791
|
+
* Disallow bitwise operators.
|
|
792
|
+
*
|
|
793
|
+
* @see https://eslint.org/docs/latest/rules/no-bitwise
|
|
794
|
+
*/
|
|
795
|
+
'no-bitwise': 'error',
|
|
796
|
+
/**
|
|
797
|
+
* Disallow `continue` statements.
|
|
798
|
+
*
|
|
799
|
+
* @see https://eslint.org/docs/latest/rules/no-continue
|
|
800
|
+
*/
|
|
801
|
+
'no-continue': 'error',
|
|
802
|
+
/**
|
|
803
|
+
* Disallow `if` statements as the only statement in `else` blocks.
|
|
804
|
+
*
|
|
805
|
+
* @see https://eslint.org/docs/latest/rules/no-lonely-if
|
|
806
|
+
*/
|
|
807
|
+
'no-lonely-if': 'error',
|
|
808
|
+
/**
|
|
809
|
+
* Disallow use of chained assignment expressions.
|
|
810
|
+
*
|
|
811
|
+
* @see https://eslint.org/docs/latest/rules/no-multi-assign
|
|
812
|
+
*/
|
|
813
|
+
'no-multi-assign': ['error'],
|
|
814
|
+
/**
|
|
815
|
+
* Disallow nested ternary expressions.
|
|
816
|
+
*
|
|
817
|
+
* @see https://eslint.org/docs/latest/rules/no-nested-ternary
|
|
818
|
+
*/
|
|
819
|
+
'no-nested-ternary': 'error',
|
|
820
|
+
/**
|
|
821
|
+
* Disallow dangling underscores in identifiers.
|
|
822
|
+
*
|
|
823
|
+
* @see https://eslint.org/docs/latest/rules/no-underscore-dangle
|
|
824
|
+
*/
|
|
825
|
+
'no-underscore-dangle': [
|
|
826
|
+
'error',
|
|
827
|
+
{
|
|
828
|
+
allow: ['__'],
|
|
829
|
+
allowAfterThis: true,
|
|
830
|
+
allowAfterSuper: true,
|
|
831
|
+
enforceInMethodNames: false,
|
|
832
|
+
},
|
|
833
|
+
],
|
|
834
|
+
/**
|
|
835
|
+
* Disallow ternary operators when simpler alternatives exist.
|
|
836
|
+
*
|
|
837
|
+
* @see https://eslint.org/docs/latest/rules/no-unneeded-ternary
|
|
838
|
+
*/
|
|
839
|
+
'no-unneeded-ternary': [
|
|
840
|
+
'error',
|
|
841
|
+
{
|
|
842
|
+
defaultAssignment: false,
|
|
843
|
+
},
|
|
844
|
+
],
|
|
845
|
+
/**
|
|
846
|
+
* Require or disallow assignment operator shorthand where possible.
|
|
847
|
+
*
|
|
848
|
+
* @see https://eslint.org/docs/latest/rules/operator-assignment
|
|
849
|
+
*/
|
|
850
|
+
'operator-assignment': ['error', 'always'],
|
|
851
|
+
/**
|
|
852
|
+
* Disallow the use of `Math.pow` in favor of the `**` operator.
|
|
853
|
+
*
|
|
854
|
+
* @see https://eslint.org/docs/latest/rules/prefer-exponentiation-operator
|
|
855
|
+
*/
|
|
856
|
+
'prefer-exponentiation-operator': 'error',
|
|
857
|
+
/**
|
|
858
|
+
* Disallow using `Object.assign` with an object literal as the first argument and
|
|
859
|
+
* prefer the use of object spread instead.
|
|
860
|
+
*
|
|
861
|
+
* @see https://eslint.org/docs/latest/rules/prefer-object-spread
|
|
862
|
+
*/
|
|
863
|
+
'prefer-object-spread': 'error',
|
|
864
|
+
/**
|
|
865
|
+
* Require or disallow Unicode byte order mark (BOM)
|
|
866
|
+
*
|
|
867
|
+
* @see https://eslint.org/docs/latest/rules/unicode-bom
|
|
868
|
+
*/
|
|
869
|
+
'unicode-bom': ['error', 'never'],
|
|
870
|
+
/**
|
|
871
|
+
* Disallow deleting variables.
|
|
872
|
+
*
|
|
873
|
+
* @see https://eslint.org/docs/latest/rules/no-delete-var
|
|
874
|
+
*/
|
|
875
|
+
'no-delete-var': 'error',
|
|
876
|
+
/**
|
|
877
|
+
* Disallow labels that share a name with a variable.
|
|
878
|
+
*
|
|
879
|
+
* @see https://eslint.org/docs/latest/rules/no-label-var
|
|
880
|
+
*/
|
|
881
|
+
'no-label-var': 'error',
|
|
882
|
+
/**
|
|
883
|
+
* Disallow variable declarations from shadowing variables declared in the outer scope.
|
|
884
|
+
*
|
|
885
|
+
* @see https://eslint.org/docs/latest/rules/no-shadow
|
|
886
|
+
*/
|
|
887
|
+
'no-shadow': 'error',
|
|
888
|
+
/**
|
|
889
|
+
* Disallow identifiers from shadowing restricted names.
|
|
890
|
+
*
|
|
891
|
+
* @see https://eslint.org/docs/latest/rules/no-shadow-restricted-names
|
|
892
|
+
*/
|
|
893
|
+
'no-shadow-restricted-names': 'error',
|
|
894
|
+
/**
|
|
895
|
+
* Disallow the use of undeclared variables unless mentioned in `/*global * /` comments.
|
|
896
|
+
*
|
|
897
|
+
* @see https://eslint.org/docs/latest/rules/no-undef
|
|
898
|
+
*/
|
|
899
|
+
'no-undef': 'error',
|
|
900
|
+
/**
|
|
901
|
+
* Disallow unused variables.
|
|
902
|
+
*
|
|
903
|
+
* @see https://eslint.org/docs/latest/rules/no-unused-vars
|
|
904
|
+
*/
|
|
905
|
+
'no-unused-vars': [
|
|
906
|
+
'error',
|
|
907
|
+
{
|
|
908
|
+
vars: 'all',
|
|
909
|
+
args: 'after-used',
|
|
910
|
+
ignoreRestSiblings: true,
|
|
911
|
+
},
|
|
912
|
+
],
|
|
913
|
+
/**
|
|
914
|
+
* Disallow the use of variables before they are defined.
|
|
915
|
+
*
|
|
916
|
+
* @see https://eslint.org/docs/latest/rules/no-use-before-define
|
|
917
|
+
*/
|
|
918
|
+
'no-use-before-define': [
|
|
919
|
+
'error',
|
|
920
|
+
{
|
|
921
|
+
functions: true,
|
|
922
|
+
classes: true,
|
|
923
|
+
variables: true,
|
|
924
|
+
},
|
|
925
|
+
],
|
|
926
|
+
/**
|
|
927
|
+
* Require braces around arrow function bodies.
|
|
928
|
+
*
|
|
929
|
+
* @see https://eslint.org/docs/latest/rules/arrow-body-style
|
|
930
|
+
*/
|
|
931
|
+
'arrow-body-style': [
|
|
932
|
+
'error',
|
|
933
|
+
'as-needed',
|
|
934
|
+
{
|
|
935
|
+
requireReturnForObjectLiteral: false,
|
|
936
|
+
},
|
|
937
|
+
],
|
|
938
|
+
/**
|
|
939
|
+
* Require `super()` calls in constructors.
|
|
940
|
+
*
|
|
941
|
+
* @see https://eslint.org/docs/latest/rules/constructor-super
|
|
942
|
+
*/
|
|
943
|
+
'constructor-super': 'error',
|
|
944
|
+
/**
|
|
945
|
+
* Disallow reassigning class members.
|
|
946
|
+
*
|
|
947
|
+
* @see https://eslint.org/docs/latest/rules/no-class-assign
|
|
948
|
+
*/
|
|
949
|
+
'no-class-assign': 'error',
|
|
950
|
+
/**
|
|
951
|
+
* Disallow reassigning `const`, `using`, and `await using` variables.
|
|
952
|
+
*
|
|
953
|
+
* @see https://eslint.org/docs/latest/rules/no-const-assign
|
|
954
|
+
*/
|
|
955
|
+
'no-const-assign': 'error',
|
|
956
|
+
/**
|
|
957
|
+
* Disallow duplicate class members.
|
|
958
|
+
*
|
|
959
|
+
* @see https://eslint.org/docs/latest/rules/no-dupe-class-members
|
|
960
|
+
*/
|
|
961
|
+
'no-dupe-class-members': 'error',
|
|
962
|
+
/**
|
|
963
|
+
* Disallow specified names in exports.
|
|
964
|
+
*
|
|
965
|
+
* @see https://eslint.org/docs/latest/rules/no-restricted-exports
|
|
966
|
+
*/
|
|
967
|
+
'no-restricted-exports': [
|
|
968
|
+
'error',
|
|
969
|
+
{
|
|
970
|
+
restrictedNamedExports: ['default', 'then'],
|
|
971
|
+
},
|
|
972
|
+
],
|
|
973
|
+
/**
|
|
974
|
+
* Disallow `this`/`super` before calling `super()` in constructors.
|
|
975
|
+
*
|
|
976
|
+
* @see https://eslint.org/docs/latest/rules/no-this-before-super
|
|
977
|
+
*/
|
|
978
|
+
'no-this-before-super': 'error',
|
|
979
|
+
/**
|
|
980
|
+
* Disallow unnecessary computed property keys in objects and classes.
|
|
981
|
+
*
|
|
982
|
+
* @see https://eslint.org/docs/latest/rules/no-useless-computed-key
|
|
983
|
+
*/
|
|
984
|
+
'no-useless-computed-key': 'error',
|
|
985
|
+
/**
|
|
986
|
+
* Disallow unnecessary constructors.
|
|
987
|
+
*
|
|
988
|
+
* @see https://eslint.org/docs/latest/rules/no-useless-constructor
|
|
989
|
+
*/
|
|
990
|
+
'no-useless-constructor': 'error',
|
|
991
|
+
/**
|
|
992
|
+
* Disallow renaming import, export, and destructured assignments to the same name.
|
|
993
|
+
*
|
|
994
|
+
* @see https://eslint.org/docs/latest/rules/no-useless-rename
|
|
995
|
+
*/
|
|
996
|
+
'no-useless-rename': [
|
|
997
|
+
'error',
|
|
998
|
+
{
|
|
999
|
+
ignoreDestructuring: false,
|
|
1000
|
+
ignoreImport: false,
|
|
1001
|
+
ignoreExport: false,
|
|
1002
|
+
},
|
|
1003
|
+
],
|
|
1004
|
+
/**
|
|
1005
|
+
* Require `let` or `const` instead of `var`
|
|
1006
|
+
*
|
|
1007
|
+
* @see https://eslint.org/docs/latest/rules/no-var
|
|
1008
|
+
*/
|
|
1009
|
+
'no-var': 'error',
|
|
1010
|
+
/**
|
|
1011
|
+
* Require or disallow method and property shorthand syntax for object literals.
|
|
1012
|
+
*
|
|
1013
|
+
* @see https://eslint.org/docs/latest/rules/object-shorthand
|
|
1014
|
+
*/
|
|
1015
|
+
'object-shorthand': [
|
|
1016
|
+
'error',
|
|
1017
|
+
'always',
|
|
1018
|
+
{
|
|
1019
|
+
ignoreConstructors: false,
|
|
1020
|
+
avoidQuotes: true,
|
|
1021
|
+
},
|
|
1022
|
+
],
|
|
1023
|
+
/**
|
|
1024
|
+
* Require using arrow functions for callbacks.
|
|
1025
|
+
*
|
|
1026
|
+
* @see https://eslint.org/docs/latest/rules/prefer-arrow-callback
|
|
1027
|
+
*/
|
|
1028
|
+
'prefer-arrow-callback': [
|
|
1029
|
+
'error',
|
|
1030
|
+
{
|
|
1031
|
+
allowNamedFunctions: false,
|
|
1032
|
+
allowUnboundThis: true,
|
|
1033
|
+
},
|
|
1034
|
+
],
|
|
1035
|
+
/**
|
|
1036
|
+
* Require `const` declarations for variables that are never reassigned after declared.
|
|
1037
|
+
*
|
|
1038
|
+
* @see https://eslint.org/docs/latest/rules/prefer-const
|
|
1039
|
+
*/
|
|
1040
|
+
'prefer-const': [
|
|
1041
|
+
'error',
|
|
1042
|
+
{
|
|
1043
|
+
destructuring: 'any',
|
|
1044
|
+
ignoreReadBeforeAssign: true,
|
|
1045
|
+
},
|
|
1046
|
+
],
|
|
1047
|
+
/**
|
|
1048
|
+
* Require destructuring from arrays and/or objects.
|
|
1049
|
+
*
|
|
1050
|
+
* @see https://eslint.org/docs/latest/rules/prefer-destructuring
|
|
1051
|
+
*/
|
|
1052
|
+
'prefer-destructuring': [
|
|
1053
|
+
'error',
|
|
1054
|
+
{
|
|
1055
|
+
VariableDeclarator: {
|
|
1056
|
+
array: false,
|
|
1057
|
+
object: true,
|
|
1058
|
+
},
|
|
1059
|
+
AssignmentExpression: {
|
|
1060
|
+
array: true,
|
|
1061
|
+
object: false,
|
|
1062
|
+
},
|
|
1063
|
+
},
|
|
1064
|
+
{
|
|
1065
|
+
enforceForRenamedProperties: false,
|
|
1066
|
+
},
|
|
1067
|
+
],
|
|
1068
|
+
/**
|
|
1069
|
+
* Disallow `parseInt()` and `Number.parseInt()` in favor of binary, octal, and
|
|
1070
|
+
* hexadecimal literals.
|
|
1071
|
+
*
|
|
1072
|
+
* @see https://eslint.org/docs/latest/rules/prefer-numeric-literals
|
|
1073
|
+
*/
|
|
1074
|
+
'prefer-numeric-literals': 'error',
|
|
1075
|
+
/**
|
|
1076
|
+
* Require rest parameters instead of `arguments`
|
|
1077
|
+
*
|
|
1078
|
+
* @see https://eslint.org/docs/latest/rules/prefer-rest-params
|
|
1079
|
+
*/
|
|
1080
|
+
'prefer-rest-params': 'error',
|
|
1081
|
+
/**
|
|
1082
|
+
* Require spread operators instead of `.apply()`
|
|
1083
|
+
*
|
|
1084
|
+
* @see https://eslint.org/docs/latest/rules/prefer-spread
|
|
1085
|
+
*/
|
|
1086
|
+
'prefer-spread': 'error',
|
|
1087
|
+
/**
|
|
1088
|
+
* Require template literals instead of string concatenation.
|
|
1089
|
+
*
|
|
1090
|
+
* @see https://eslint.org/docs/latest/rules/prefer-template
|
|
1091
|
+
*/
|
|
1092
|
+
'prefer-template': 'error',
|
|
1093
|
+
/**
|
|
1094
|
+
* Require generator functions to contain `yield`
|
|
1095
|
+
*
|
|
1096
|
+
* @see https://eslint.org/docs/latest/rules/require-yield
|
|
1097
|
+
*/
|
|
1098
|
+
'require-yield': 'error',
|
|
1099
|
+
/**
|
|
1100
|
+
* Require symbol descriptions.
|
|
1101
|
+
*
|
|
1102
|
+
* @see https://eslint.org/docs/latest/rules/symbol-description
|
|
1103
|
+
*/
|
|
1104
|
+
'symbol-description': 'error',
|
|
1105
|
+
/**
|
|
1106
|
+
* Ensure named imports correspond to a named export in the remote file.
|
|
1107
|
+
*
|
|
1108
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.1/docs/rules/named.md
|
|
1109
|
+
*/
|
|
1110
|
+
'import/named': 'error',
|
|
1111
|
+
/**
|
|
1112
|
+
* Forbid any invalid exports, i.e. re-export of the same name.
|
|
1113
|
+
*
|
|
1114
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.1/docs/rules/export.md
|
|
1115
|
+
*/
|
|
1116
|
+
'import/export': 'error',
|
|
1117
|
+
/**
|
|
1118
|
+
* Forbid use of exported name as identifier of default export.
|
|
1119
|
+
*
|
|
1120
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.1/docs/rules/no-named-as-default.md
|
|
1121
|
+
*/
|
|
1122
|
+
'import/no-named-as-default': 'error',
|
|
1123
|
+
/**
|
|
1124
|
+
* Forbid use of exported name as property of default export.
|
|
1125
|
+
*
|
|
1126
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.1/docs/rules/no-named-as-default-member.md
|
|
1127
|
+
*/
|
|
1128
|
+
'import/no-named-as-default-member': 'error',
|
|
1129
|
+
/**
|
|
1130
|
+
* Forbid the use of mutable exports with `var` or `let`.
|
|
1131
|
+
*
|
|
1132
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.1/docs/rules/no-mutable-exports.md
|
|
1133
|
+
*/
|
|
1134
|
+
'import/no-mutable-exports': 'error',
|
|
1135
|
+
/**
|
|
1136
|
+
* Forbid AMD `require` and `define` calls.
|
|
1137
|
+
*
|
|
1138
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.1/docs/rules/no-amd.md
|
|
1139
|
+
*/
|
|
1140
|
+
'import/no-amd': 'error',
|
|
1141
|
+
/**
|
|
1142
|
+
* Ensure all imports appear before other statements.
|
|
1143
|
+
*
|
|
1144
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.1/docs/rules/first.md
|
|
1145
|
+
*/
|
|
1146
|
+
'import/first': 'error',
|
|
1147
|
+
/**
|
|
1148
|
+
* Forbid repeated import of the same module in multiple places.
|
|
1149
|
+
*
|
|
1150
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.1/docs/rules/no-duplicates.md
|
|
1151
|
+
*/
|
|
1152
|
+
'import/no-duplicates': 'error',
|
|
1153
|
+
/**
|
|
1154
|
+
* Ensure consistent use of file extension within the import path.
|
|
1155
|
+
*
|
|
1156
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.1/docs/rules/extensions.md
|
|
1157
|
+
*/
|
|
1158
|
+
'import/extensions': [
|
|
1159
|
+
'error',
|
|
1160
|
+
'ignorePackages',
|
|
1161
|
+
{
|
|
1162
|
+
js: 'never',
|
|
1163
|
+
mjs: 'never',
|
|
1164
|
+
jsx: 'never',
|
|
1165
|
+
},
|
|
1166
|
+
],
|
|
1167
|
+
/**
|
|
1168
|
+
* Enforce a newline after import statements.
|
|
1169
|
+
*
|
|
1170
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.1/docs/rules/newline-after-import.md
|
|
1171
|
+
*/
|
|
1172
|
+
'import/newline-after-import': 'error',
|
|
1173
|
+
/**
|
|
1174
|
+
* Forbid import of modules using absolute paths.
|
|
1175
|
+
*
|
|
1176
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.1/docs/rules/no-absolute-path.md
|
|
1177
|
+
*/
|
|
1178
|
+
'import/no-absolute-path': 'error',
|
|
1179
|
+
/**
|
|
1180
|
+
* Forbid `require()` calls with expressions.
|
|
1181
|
+
*
|
|
1182
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.1/docs/rules/no-dynamic-require.md
|
|
1183
|
+
*/
|
|
1184
|
+
'import/no-dynamic-require': 'error',
|
|
1185
|
+
/**
|
|
1186
|
+
* Forbid webpack loader syntax in imports.
|
|
1187
|
+
*
|
|
1188
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.1/docs/rules/no-webpack-loader-syntax.md
|
|
1189
|
+
*/
|
|
1190
|
+
'import/no-webpack-loader-syntax': 'error',
|
|
1191
|
+
/**
|
|
1192
|
+
* Forbid named default exports.
|
|
1193
|
+
*
|
|
1194
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.1/docs/rules/no-named-default.md
|
|
1195
|
+
*/
|
|
1196
|
+
'import/no-named-default': 'error',
|
|
1197
|
+
/**
|
|
1198
|
+
* Forbid a module from importing itself.
|
|
1199
|
+
*
|
|
1200
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.1/docs/rules/no-self-import.md
|
|
1201
|
+
*/
|
|
1202
|
+
'import/no-self-import': 'error',
|
|
1203
|
+
/**
|
|
1204
|
+
* Forbid a module from importing a module with a dependency path back to itself.
|
|
1205
|
+
*
|
|
1206
|
+
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.17.1/docs/rules/no-cycle.md
|
|
1207
|
+
*/
|
|
1208
|
+
'import/no-cycle': [
|
|
1209
|
+
'error',
|
|
1210
|
+
{
|
|
1211
|
+
maxDepth: 4294967295,
|
|
1212
|
+
},
|
|
1213
|
+
],
|
|
1214
|
+
} as const;
|