zeno-config 0.1.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 +271 -0
- package/package.json +89 -0
- package/src/eslint/index.d.ts +124 -0
- package/src/eslint/index.js +373 -0
- package/src/eslint/rules/baseRules.js +753 -0
- package/src/eslint/rules/importPluginRules.js +200 -0
- package/src/eslint/rules/jsxA11yPluginRules.js +195 -0
- package/src/eslint/rules/nodePluginRules.js +128 -0
- package/src/eslint/rules/reactHooksPluginRules.js +27 -0
- package/src/eslint/rules/reactPluginRules.js +476 -0
- package/src/eslint/rules/reactYouMightNotNeedAnEffectPluginRules.js +21 -0
- package/src/eslint/rules/stylisticPluginRules.js +330 -0
- package/src/eslint/rules/typescriptPluginRules.js +533 -0
- package/src/eslint/rules/unicornPluginRules.js +441 -0
- package/src/extensions.d.ts +51 -0
- package/src/extensions.js +49 -0
- package/src/prettier.d.ts +4 -0
- package/src/prettier.js +16 -0
- package/src/tsconfig.base.json +31 -0
- package/src/tsconfig.react.json +13 -0
|
@@ -0,0 +1,753 @@
|
|
|
1
|
+
const getBaseRules = () => {
|
|
2
|
+
return {
|
|
3
|
+
// https://eslint.org/docs/latest/rules/array-callback-return
|
|
4
|
+
'array-callback-return': ['error', { allowImplicit: true }],
|
|
5
|
+
|
|
6
|
+
// TODO: test this, may only be needed in JS and disabled in TS
|
|
7
|
+
// https://eslint.org/docs/latest/rules/constructor-super
|
|
8
|
+
'constructor-super': 'error',
|
|
9
|
+
|
|
10
|
+
// https://eslint.org/docs/latest/rules/for-direction
|
|
11
|
+
'for-direction': 'error',
|
|
12
|
+
|
|
13
|
+
// TODO: test this, may only be needed in JS and disabled in TS
|
|
14
|
+
// https://eslint.org/docs/latest/rules/getter-return
|
|
15
|
+
'getter-return': ['error', { allowImplicit: true }],
|
|
16
|
+
|
|
17
|
+
// https://eslint.org/docs/latest/rules/no-async-promise-executor
|
|
18
|
+
'no-async-promise-executor': 'error',
|
|
19
|
+
|
|
20
|
+
// https://eslint.org/docs/latest/rules/no-await-in-loop
|
|
21
|
+
'no-await-in-loop': 'warn',
|
|
22
|
+
|
|
23
|
+
// TODO: test this, may only be needed in JS and disabled in TS
|
|
24
|
+
// https://eslint.org/docs/latest/rules/no-class-assign
|
|
25
|
+
'no-class-assign': 'error',
|
|
26
|
+
|
|
27
|
+
// https://eslint.org/docs/latest/rules/no-compare-neg-zero
|
|
28
|
+
'no-compare-neg-zero': 'error',
|
|
29
|
+
|
|
30
|
+
// https://eslint.org/docs/latest/rules/no-cond-assign
|
|
31
|
+
'no-cond-assign': ['error', 'always'],
|
|
32
|
+
|
|
33
|
+
// TODO: test this, may only be needed in JS and disabled in TS
|
|
34
|
+
// https://eslint.org/docs/latest/rules/no-const-assign
|
|
35
|
+
'no-const-assign': 'error',
|
|
36
|
+
|
|
37
|
+
// https://eslint.org/docs/latest/rules/no-constant-binary-expression
|
|
38
|
+
'no-constant-binary-expression': 'off',
|
|
39
|
+
|
|
40
|
+
// https://eslint.org/docs/latest/rules/no-constant-condition
|
|
41
|
+
'no-constant-condition': 'error',
|
|
42
|
+
|
|
43
|
+
// https://eslint.org/docs/latest/rules/no-constructor-return
|
|
44
|
+
'no-constructor-return': 'error',
|
|
45
|
+
|
|
46
|
+
// https://eslint.org/docs/latest/rules/no-control-regex
|
|
47
|
+
'no-control-regex': 'error',
|
|
48
|
+
|
|
49
|
+
// https://eslint.org/docs/latest/rules/no-debugger
|
|
50
|
+
'no-debugger': 'error',
|
|
51
|
+
|
|
52
|
+
// TODO: test this, may only be needed in JS and disabled in TS
|
|
53
|
+
// https://eslint.org/docs/latest/rules/no-dupe-args
|
|
54
|
+
'no-dupe-args': 'error',
|
|
55
|
+
|
|
56
|
+
// TODO: test this, may only be needed in JS and disabled in TS
|
|
57
|
+
// https://eslint.org/docs/latest/rules/no-dupe-class-members
|
|
58
|
+
'no-dupe-class-members': 'error',
|
|
59
|
+
|
|
60
|
+
// https://eslint.org/docs/latest/rules/no-dupe-else-if
|
|
61
|
+
'no-dupe-else-if': 'error',
|
|
62
|
+
|
|
63
|
+
// TODO: test this, may only be needed in JS and disabled in TS
|
|
64
|
+
// https://eslint.org/docs/latest/rules/no-dupe-keys
|
|
65
|
+
'no-dupe-keys': 'error',
|
|
66
|
+
|
|
67
|
+
// https://eslint.org/docs/latest/rules/no-duplicate-case
|
|
68
|
+
'no-duplicate-case': 'error',
|
|
69
|
+
|
|
70
|
+
// https://eslint.org/docs/latest/rules/no-duplicate-imports
|
|
71
|
+
'no-duplicate-imports': 'off',
|
|
72
|
+
|
|
73
|
+
// https://eslint.org/docs/latest/rules/no-empty-character-class
|
|
74
|
+
'no-empty-character-class': 'error',
|
|
75
|
+
|
|
76
|
+
// https://eslint.org/docs/latest/rules/no-empty-pattern
|
|
77
|
+
'no-empty-pattern': 'error',
|
|
78
|
+
|
|
79
|
+
// https://eslint.org/docs/latest/rules/no-ex-assign
|
|
80
|
+
'no-ex-assign': 'error',
|
|
81
|
+
|
|
82
|
+
// https://eslint.org/docs/latest/rules/no-fallthrough
|
|
83
|
+
'no-fallthrough': 'error',
|
|
84
|
+
|
|
85
|
+
// TODO: test this, may only be needed in JS and disabled in TS
|
|
86
|
+
// https://eslint.org/docs/latest/rules/no-func-assign
|
|
87
|
+
'no-func-assign': 'error',
|
|
88
|
+
|
|
89
|
+
// may still need this for TS since there is a scenario where you can assign an import to a variable
|
|
90
|
+
// TODO: test this, may only be needed in JS and disabled in TS
|
|
91
|
+
// https://eslint.org/docs/latest/rules/no-import-assign
|
|
92
|
+
'no-import-assign': 'error',
|
|
93
|
+
|
|
94
|
+
// https://eslint.org/docs/latest/rules/no-inner-declarations
|
|
95
|
+
'no-inner-declarations': 'off',
|
|
96
|
+
|
|
97
|
+
// https://eslint.org/docs/latest/rules/no-invalid-regexp
|
|
98
|
+
'no-invalid-regexp': 'error',
|
|
99
|
+
|
|
100
|
+
// https://eslint.org/docs/latest/rules/no-irregular-whitespace
|
|
101
|
+
'no-irregular-whitespace': 'error',
|
|
102
|
+
|
|
103
|
+
// https://eslint.org/docs/latest/rules/no-loss-of-precision
|
|
104
|
+
'no-loss-of-precision': 'error',
|
|
105
|
+
|
|
106
|
+
// https://eslint.org/docs/latest/rules/no-misleading-character-class
|
|
107
|
+
'no-misleading-character-class': 'error',
|
|
108
|
+
|
|
109
|
+
// TODO: test this, may only be needed in JS and disabled in TS
|
|
110
|
+
// https://eslint.org/docs/latest/rules/no-new-native-nonconstructor
|
|
111
|
+
'no-new-native-nonconstructor': 'error',
|
|
112
|
+
|
|
113
|
+
// TODO: test this, may only be needed in JS and disabled in TS
|
|
114
|
+
// https://eslint.org/docs/latest/rules/no-obj-calls
|
|
115
|
+
'no-obj-calls': 'error',
|
|
116
|
+
|
|
117
|
+
// https://eslint.org/docs/latest/rules/no-promise-executor-return
|
|
118
|
+
'no-promise-executor-return': 'error',
|
|
119
|
+
|
|
120
|
+
// https://eslint.org/docs/latest/rules/no-prototype-builtins
|
|
121
|
+
'no-prototype-builtins': 'error',
|
|
122
|
+
|
|
123
|
+
// https://eslint.org/docs/latest/rules/no-self-assign
|
|
124
|
+
'no-self-assign': ['error', { props: true }],
|
|
125
|
+
|
|
126
|
+
// https://eslint.org/docs/latest/rules/no-self-compare
|
|
127
|
+
'no-self-compare': 'error',
|
|
128
|
+
|
|
129
|
+
// TODO: test this, may only be needed in JS and disabled in TS
|
|
130
|
+
// https://eslint.org/docs/latest/rules/no-setter-return
|
|
131
|
+
'no-setter-return': 'error',
|
|
132
|
+
|
|
133
|
+
// https://eslint.org/docs/latest/rules/no-sparse-arrays
|
|
134
|
+
'no-sparse-arrays': 'error',
|
|
135
|
+
|
|
136
|
+
// https://eslint.org/docs/latest/rules/no-template-curly-in-string
|
|
137
|
+
'no-template-curly-in-string': 'error',
|
|
138
|
+
|
|
139
|
+
// TODO: test this, may only be needed in JS and disabled in TS
|
|
140
|
+
// https://eslint.org/docs/latest/rules/no-this-before-super
|
|
141
|
+
'no-this-before-super': 'error',
|
|
142
|
+
|
|
143
|
+
// https://eslint.org/docs/latest/rules/no-unassigned-vars
|
|
144
|
+
'no-unassigned-vars': 'error',
|
|
145
|
+
|
|
146
|
+
// TODO: test this, may only be needed in JS and disabled in TS
|
|
147
|
+
// https://eslint.org/docs/latest/rules/no-undef
|
|
148
|
+
'no-undef': ['error', { typeof: true }],
|
|
149
|
+
|
|
150
|
+
// https://eslint.org/docs/latest/rules/no-unexpected-multiline
|
|
151
|
+
'no-unexpected-multiline': 'error',
|
|
152
|
+
|
|
153
|
+
// https://eslint.org/docs/latest/rules/no-unmodified-loop-condition
|
|
154
|
+
'no-unmodified-loop-condition': 'error',
|
|
155
|
+
|
|
156
|
+
// TODO: test this, may only be needed in JS and disabled in TS (only if allowUnreachableCode: false in config)
|
|
157
|
+
// https://eslint.org/docs/latest/rules/no-unreachable
|
|
158
|
+
'no-unreachable': 'error',
|
|
159
|
+
|
|
160
|
+
// https://eslint.org/docs/latest/rules/no-unreachable-loop
|
|
161
|
+
'no-unreachable-loop': 'error',
|
|
162
|
+
|
|
163
|
+
// https://eslint.org/docs/latest/rules/no-unsafe-finally
|
|
164
|
+
'no-unsafe-finally': 'error',
|
|
165
|
+
|
|
166
|
+
// TODO: test this, may only be needed in JS and disabled in TS
|
|
167
|
+
// https://eslint.org/docs/latest/rules/no-unsafe-negation
|
|
168
|
+
'no-unsafe-negation': ['error', { enforceForOrderingRelations: true }],
|
|
169
|
+
|
|
170
|
+
// https://eslint.org/docs/latest/rules/no-unsafe-optional-chaining
|
|
171
|
+
'no-unsafe-optional-chaining': [
|
|
172
|
+
'error',
|
|
173
|
+
{ disallowArithmeticOperators: true },
|
|
174
|
+
],
|
|
175
|
+
|
|
176
|
+
// https://eslint.org/docs/latest/rules/no-unused-private-class-members
|
|
177
|
+
'no-unused-private-class-members': 'error',
|
|
178
|
+
|
|
179
|
+
// https://eslint.org/docs/latest/rules/no-unused-vars
|
|
180
|
+
'no-unused-vars': [
|
|
181
|
+
'error',
|
|
182
|
+
{
|
|
183
|
+
vars: 'all',
|
|
184
|
+
args: 'after-used',
|
|
185
|
+
caughtErrors: 'none',
|
|
186
|
+
ignoreRestSiblings: false,
|
|
187
|
+
ignoreClassWithStaticInitBlock: false,
|
|
188
|
+
ignoreUsingDeclarations: false,
|
|
189
|
+
reportUsedIgnorePattern: false,
|
|
190
|
+
},
|
|
191
|
+
],
|
|
192
|
+
|
|
193
|
+
// https://eslint.org/docs/latest/rules/no-use-before-define
|
|
194
|
+
'no-use-before-define': [
|
|
195
|
+
'error',
|
|
196
|
+
{
|
|
197
|
+
functions: true,
|
|
198
|
+
classes: true,
|
|
199
|
+
variables: true,
|
|
200
|
+
allowNamedExports: false,
|
|
201
|
+
|
|
202
|
+
// typescript only
|
|
203
|
+
enums: true,
|
|
204
|
+
typedefs: true,
|
|
205
|
+
ignoreTypeReferences: true,
|
|
206
|
+
},
|
|
207
|
+
],
|
|
208
|
+
|
|
209
|
+
// https://eslint.org/docs/latest/rules/no-useless-assignment
|
|
210
|
+
'no-useless-assignment': 'error',
|
|
211
|
+
|
|
212
|
+
// https://eslint.org/docs/latest/rules/no-useless-backreference
|
|
213
|
+
'no-useless-backreference': 'error',
|
|
214
|
+
|
|
215
|
+
// https://eslint.org/docs/latest/rules/require-atomic-updates
|
|
216
|
+
'require-atomic-updates': ['error', { allowProperties: false }],
|
|
217
|
+
|
|
218
|
+
// https://eslint.org/docs/latest/rules/use-isnan
|
|
219
|
+
'use-isnan': 'error',
|
|
220
|
+
|
|
221
|
+
// https://eslint.org/docs/latest/rules/valid-typeof
|
|
222
|
+
'valid-typeof': ['error', { requireStringLiterals: true }],
|
|
223
|
+
|
|
224
|
+
// https://eslint.org/docs/latest/rules/accessor-pairs
|
|
225
|
+
'accessor-pairs': 'error',
|
|
226
|
+
|
|
227
|
+
// https://eslint.org/docs/latest/rules/arrow-body-style
|
|
228
|
+
'arrow-body-style': 'off',
|
|
229
|
+
|
|
230
|
+
// https://eslint.org/docs/latest/rules/block-scoped-var
|
|
231
|
+
'block-scoped-var': 'error',
|
|
232
|
+
|
|
233
|
+
// https://eslint.org/docs/latest/rules/camelcase
|
|
234
|
+
camelcase: [
|
|
235
|
+
'error',
|
|
236
|
+
{
|
|
237
|
+
properties: 'always',
|
|
238
|
+
ignoreDestructuring: false,
|
|
239
|
+
ignoreImports: false,
|
|
240
|
+
ignoreGlobals: false,
|
|
241
|
+
allow: [],
|
|
242
|
+
},
|
|
243
|
+
],
|
|
244
|
+
|
|
245
|
+
// https://eslint.org/docs/latest/rules/capitalized-comments
|
|
246
|
+
'capitalized-comments': 'off',
|
|
247
|
+
|
|
248
|
+
// https://eslint.org/docs/latest/rules/class-methods-use-this
|
|
249
|
+
'class-methods-use-this': 'off',
|
|
250
|
+
|
|
251
|
+
// https://eslint.org/docs/latest/rules/complexity
|
|
252
|
+
complexity: 'off',
|
|
253
|
+
|
|
254
|
+
// https://eslint.org/docs/latest/rules/consistent-return
|
|
255
|
+
'consistent-return': 'off',
|
|
256
|
+
|
|
257
|
+
// https://eslint.org/docs/latest/rules/consistent-this
|
|
258
|
+
'consistent-this': 'error',
|
|
259
|
+
|
|
260
|
+
// https://eslint.org/docs/latest/rules/curly
|
|
261
|
+
curly: 'error',
|
|
262
|
+
|
|
263
|
+
// https://eslint.org/docs/latest/rules/default-case
|
|
264
|
+
'default-case': ['error', { commentPattern: '^no default$' }],
|
|
265
|
+
|
|
266
|
+
// https://eslint.org/docs/latest/rules/default-case-last
|
|
267
|
+
'default-case-last': 'error',
|
|
268
|
+
|
|
269
|
+
// https://eslint.org/docs/latest/rules/default-param-last
|
|
270
|
+
'default-param-last': 'error',
|
|
271
|
+
|
|
272
|
+
// https://eslint.org/docs/latest/rules/dot-notation
|
|
273
|
+
'dot-notation': ['error', { allowKeywords: true }],
|
|
274
|
+
|
|
275
|
+
// https://eslint.org/docs/latest/rules/eqeqeq
|
|
276
|
+
eqeqeq: ['error', 'always', { null: 'ignore' }],
|
|
277
|
+
|
|
278
|
+
// https://eslint.org/docs/latest/rules/func-name-matching
|
|
279
|
+
'func-name-matching': 'off',
|
|
280
|
+
|
|
281
|
+
// https://eslint.org/docs/latest/rules/func-names
|
|
282
|
+
'func-names': ['warn', 'as-needed'],
|
|
283
|
+
|
|
284
|
+
// https://eslint.org/docs/latest/rules/func-style
|
|
285
|
+
'func-style': [
|
|
286
|
+
'error',
|
|
287
|
+
'declaration',
|
|
288
|
+
{ allowArrowFunctions: true, allowTypeAnnotation: true },
|
|
289
|
+
],
|
|
290
|
+
|
|
291
|
+
// https://eslint.org/docs/latest/rules/grouped-accessor-pairs
|
|
292
|
+
'grouped-accessor-pairs': [
|
|
293
|
+
'error',
|
|
294
|
+
'getBeforeSet',
|
|
295
|
+
{ enforceForTSTypes: true },
|
|
296
|
+
],
|
|
297
|
+
|
|
298
|
+
// https://eslint.org/docs/latest/rules/guard-for-in
|
|
299
|
+
'guard-for-in': 'error',
|
|
300
|
+
|
|
301
|
+
// https://eslint.org/docs/latest/rules/id-denylist
|
|
302
|
+
'id-denylist': 'off',
|
|
303
|
+
|
|
304
|
+
// https://eslint.org/docs/latest/rules/id-length
|
|
305
|
+
'id-length': 'off',
|
|
306
|
+
|
|
307
|
+
// https://eslint.org/docs/latest/rules/id-match
|
|
308
|
+
'id-match': 'off',
|
|
309
|
+
|
|
310
|
+
// https://eslint.org/docs/latest/rules/init-declarations
|
|
311
|
+
'init-declarations': 'off',
|
|
312
|
+
|
|
313
|
+
// https://eslint.org/docs/latest/rules/logical-assignment-operators
|
|
314
|
+
'logical-assignment-operators': 'off',
|
|
315
|
+
|
|
316
|
+
// https://eslint.org/docs/latest/rules/max-classes-per-file
|
|
317
|
+
'max-classes-per-file': 'off',
|
|
318
|
+
|
|
319
|
+
// https://eslint.org/docs/latest/rules/max-depth
|
|
320
|
+
'max-depth': 'off',
|
|
321
|
+
|
|
322
|
+
// https://eslint.org/docs/latest/rules/max-lines
|
|
323
|
+
'max-lines': 'off',
|
|
324
|
+
|
|
325
|
+
// https://eslint.org/docs/latest/rules/max-lines-per-function
|
|
326
|
+
'max-lines-per-function': 'off',
|
|
327
|
+
|
|
328
|
+
// https://eslint.org/docs/latest/rules/max-nested-callbacks
|
|
329
|
+
'max-nested-callbacks': 'off',
|
|
330
|
+
|
|
331
|
+
// https://eslint.org/docs/latest/rules/max-params
|
|
332
|
+
'max-params': 'off',
|
|
333
|
+
|
|
334
|
+
// https://eslint.org/docs/latest/rules/max-statements
|
|
335
|
+
'max-statements': 'off',
|
|
336
|
+
|
|
337
|
+
// https://eslint.org/docs/latest/rules/new-cap
|
|
338
|
+
'new-cap': [
|
|
339
|
+
'error',
|
|
340
|
+
{
|
|
341
|
+
newIsCap: true,
|
|
342
|
+
capIsNew: true,
|
|
343
|
+
properties: true,
|
|
344
|
+
},
|
|
345
|
+
],
|
|
346
|
+
|
|
347
|
+
// https://eslint.org/docs/latest/rules/no-alert
|
|
348
|
+
'no-alert': 'warn',
|
|
349
|
+
|
|
350
|
+
// https://eslint.org/docs/latest/rules/no-array-constructor
|
|
351
|
+
'no-array-constructor': 'error',
|
|
352
|
+
|
|
353
|
+
// https://eslint.org/docs/latest/rules/no-bitwise
|
|
354
|
+
'no-bitwise': 'error',
|
|
355
|
+
|
|
356
|
+
// https://eslint.org/docs/latest/rules/no-caller
|
|
357
|
+
'no-caller': 'error',
|
|
358
|
+
|
|
359
|
+
// https://eslint.org/docs/latest/rules/no-case-declarations
|
|
360
|
+
'no-case-declarations': 'error',
|
|
361
|
+
|
|
362
|
+
// https://eslint.org/docs/latest/rules/no-console
|
|
363
|
+
'no-console': 'warn',
|
|
364
|
+
|
|
365
|
+
// https://eslint.org/docs/latest/rules/no-continue
|
|
366
|
+
'no-continue': 'off',
|
|
367
|
+
|
|
368
|
+
// https://eslint.org/docs/latest/rules/no-delete-var
|
|
369
|
+
'no-delete-var': 'error',
|
|
370
|
+
|
|
371
|
+
// https://eslint.org/docs/latest/rules/no-div-regex
|
|
372
|
+
'no-div-regex': 'off',
|
|
373
|
+
|
|
374
|
+
// https://eslint.org/docs/latest/rules/no-else-return
|
|
375
|
+
'no-else-return': 'error',
|
|
376
|
+
|
|
377
|
+
// https://eslint.org/docs/latest/rules/no-empty
|
|
378
|
+
'no-empty': 'error',
|
|
379
|
+
|
|
380
|
+
// https://eslint.org/docs/latest/rules/no-empty-function
|
|
381
|
+
'no-empty-function': [
|
|
382
|
+
'error',
|
|
383
|
+
{
|
|
384
|
+
allow: ['arrowFunctions'],
|
|
385
|
+
},
|
|
386
|
+
],
|
|
387
|
+
|
|
388
|
+
// https://eslint.org/docs/latest/rules/no-empty-static-block
|
|
389
|
+
'no-empty-static-block': 'error',
|
|
390
|
+
|
|
391
|
+
// Using eqeqeq rule instead
|
|
392
|
+
// https://eslint.org/docs/latest/rules/no-eq-null
|
|
393
|
+
'no-eq-null': 'off',
|
|
394
|
+
|
|
395
|
+
// https://eslint.org/docs/latest/rules/no-eval
|
|
396
|
+
'no-eval': 'error',
|
|
397
|
+
|
|
398
|
+
// https://eslint.org/docs/latest/rules/no-extend-native
|
|
399
|
+
'no-extend-native': 'error',
|
|
400
|
+
|
|
401
|
+
// https://eslint.org/docs/latest/rules/no-extra-bind
|
|
402
|
+
'no-extra-bind': 'error',
|
|
403
|
+
|
|
404
|
+
// https://eslint.org/docs/latest/rules/no-extra-boolean-cast
|
|
405
|
+
'no-extra-boolean-cast': 'error',
|
|
406
|
+
|
|
407
|
+
// https://eslint.org/docs/latest/rules/no-extra-label
|
|
408
|
+
'no-extra-label': 'error',
|
|
409
|
+
|
|
410
|
+
// https://eslint.org/docs/latest/rules/no-global-assign
|
|
411
|
+
'no-global-assign': 'error',
|
|
412
|
+
|
|
413
|
+
// https://eslint.org/docs/latest/rules/no-implicit-coercion
|
|
414
|
+
'no-implicit-coercion': [
|
|
415
|
+
'error',
|
|
416
|
+
{
|
|
417
|
+
boolean: true,
|
|
418
|
+
number: true,
|
|
419
|
+
string: true,
|
|
420
|
+
disallowTemplateShorthand: true,
|
|
421
|
+
allow: ['!!', '~'],
|
|
422
|
+
},
|
|
423
|
+
],
|
|
424
|
+
|
|
425
|
+
// https://eslint.org/docs/latest/rules/no-implicit-globals
|
|
426
|
+
'no-implicit-globals': 'off',
|
|
427
|
+
|
|
428
|
+
// https://eslint.org/docs/latest/rules/no-implied-eval
|
|
429
|
+
'no-implied-eval': 'error',
|
|
430
|
+
|
|
431
|
+
// https://eslint.org/docs/latest/rules/no-inline-comments
|
|
432
|
+
'no-inline-comments': 'off',
|
|
433
|
+
|
|
434
|
+
// https://eslint.org/docs/latest/rules/no-invalid-this
|
|
435
|
+
'no-invalid-this': ['error', { capIsConstructor: false }],
|
|
436
|
+
|
|
437
|
+
// https://eslint.org/docs/latest/rules/no-iterator
|
|
438
|
+
'no-iterator': 'error',
|
|
439
|
+
|
|
440
|
+
// https://eslint.org/docs/latest/rules/no-label-var
|
|
441
|
+
'no-label-var': 'error',
|
|
442
|
+
|
|
443
|
+
// https://eslint.org/docs/latest/rules/no-labels
|
|
444
|
+
'no-labels': 'error',
|
|
445
|
+
|
|
446
|
+
// https://eslint.org/docs/latest/rules/no-lone-blocks
|
|
447
|
+
'no-lone-blocks': 'error',
|
|
448
|
+
|
|
449
|
+
// https://eslint.org/docs/latest/rules/no-lonely-if
|
|
450
|
+
'no-lonely-if': 'error',
|
|
451
|
+
|
|
452
|
+
// https://eslint.org/docs/latest/rules/no-loop-func
|
|
453
|
+
'no-loop-func': 'error',
|
|
454
|
+
|
|
455
|
+
// https://eslint.org/docs/latest/rules/no-magic-numbers
|
|
456
|
+
'no-magic-numbers': 'off',
|
|
457
|
+
|
|
458
|
+
// https://eslint.org/docs/latest/rules/no-multi-assign
|
|
459
|
+
'no-multi-assign': 'error',
|
|
460
|
+
|
|
461
|
+
// https://eslint.org/docs/latest/rules/no-multi-str
|
|
462
|
+
'no-multi-str': 'error',
|
|
463
|
+
|
|
464
|
+
// https://eslint.org/docs/latest/rules/no-negated-condition
|
|
465
|
+
'no-negated-condition': 'off',
|
|
466
|
+
|
|
467
|
+
// https://eslint.org/docs/latest/rules/no-nested-ternary
|
|
468
|
+
'no-nested-ternary': 'error',
|
|
469
|
+
|
|
470
|
+
// https://eslint.org/docs/latest/rules/no-new
|
|
471
|
+
'no-new': 'error',
|
|
472
|
+
|
|
473
|
+
// https://eslint.org/docs/latest/rules/no-new-func
|
|
474
|
+
'no-new-func': 'error',
|
|
475
|
+
|
|
476
|
+
// https://eslint.org/docs/latest/rules/no-new-wrappers
|
|
477
|
+
'no-new-wrappers': 'error',
|
|
478
|
+
|
|
479
|
+
// https://eslint.org/docs/latest/rules/no-nonoctal-decimal-escape
|
|
480
|
+
'no-nonoctal-decimal-escape': 'error',
|
|
481
|
+
|
|
482
|
+
// https://eslint.org/docs/latest/rules/no-object-constructor
|
|
483
|
+
'no-object-constructor': 'error',
|
|
484
|
+
|
|
485
|
+
// https://eslint.org/docs/latest/rules/no-octal
|
|
486
|
+
'no-octal': 'error',
|
|
487
|
+
|
|
488
|
+
// https://eslint.org/docs/latest/rules/no-octal-escape
|
|
489
|
+
'no-octal-escape': 'error',
|
|
490
|
+
|
|
491
|
+
// https://eslint.org/docs/latest/rules/no-param-reassign
|
|
492
|
+
'no-param-reassign': [
|
|
493
|
+
'off', // not needed with ESM
|
|
494
|
+
{
|
|
495
|
+
props: true,
|
|
496
|
+
ignorePropertyModificationsFor: [
|
|
497
|
+
'acc', // for reduce accumulators
|
|
498
|
+
'req', // for Express requests
|
|
499
|
+
'res', // for Express responses
|
|
500
|
+
],
|
|
501
|
+
ignorePropertyModificationsForRegex: [
|
|
502
|
+
'^_safe', // to bypass the rule and signify that the property is safe to mutate
|
|
503
|
+
],
|
|
504
|
+
},
|
|
505
|
+
],
|
|
506
|
+
|
|
507
|
+
// https://eslint.org/docs/latest/rules/no-plusplus
|
|
508
|
+
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
|
|
509
|
+
|
|
510
|
+
// https://eslint.org/docs/latest/rules/no-proto
|
|
511
|
+
'no-proto': 'error',
|
|
512
|
+
|
|
513
|
+
// https://eslint.org/docs/latest/rules/no-redeclare
|
|
514
|
+
'no-redeclare': 'error',
|
|
515
|
+
|
|
516
|
+
// https://eslint.org/docs/latest/rules/no-regex-spaces
|
|
517
|
+
'no-regex-spaces': 'error',
|
|
518
|
+
|
|
519
|
+
// https://eslint.org/docs/latest/rules/no-restricted-exports
|
|
520
|
+
'no-restricted-exports': [
|
|
521
|
+
'error',
|
|
522
|
+
{
|
|
523
|
+
restrictedNamedExports: [
|
|
524
|
+
'default', // naming an export 'default' is likely a mistake
|
|
525
|
+
],
|
|
526
|
+
},
|
|
527
|
+
],
|
|
528
|
+
|
|
529
|
+
// https://eslint.org/docs/latest/rules/no-restricted-globals
|
|
530
|
+
'no-restricted-globals': 'off',
|
|
531
|
+
|
|
532
|
+
// https://eslint.org/docs/latest/rules/no-restricted-imports
|
|
533
|
+
'no-restricted-imports': 'off',
|
|
534
|
+
|
|
535
|
+
// https://eslint.org/docs/latest/rules/no-restricted-properties
|
|
536
|
+
'no-restricted-properties': 'off',
|
|
537
|
+
|
|
538
|
+
// https://eslint.org/docs/latest/rules/no-restricted-syntax
|
|
539
|
+
'no-restricted-syntax': 'off',
|
|
540
|
+
|
|
541
|
+
// https://eslint.org/docs/latest/rules/no-return-assign
|
|
542
|
+
'no-return-assign': ['error', 'always'],
|
|
543
|
+
|
|
544
|
+
// https://eslint.org/docs/latest/rules/no-script-url
|
|
545
|
+
'no-script-url': 'error',
|
|
546
|
+
|
|
547
|
+
// https://eslint.org/docs/latest/rules/no-sequences
|
|
548
|
+
'no-sequences': 'error',
|
|
549
|
+
|
|
550
|
+
// https://eslint.org/docs/latest/rules/no-shadow
|
|
551
|
+
'no-shadow': 'error',
|
|
552
|
+
|
|
553
|
+
// https://eslint.org/docs/latest/rules/no-shadow-restricted-names
|
|
554
|
+
'no-shadow-restricted-names': ['error', { reportGlobalThis: true }],
|
|
555
|
+
|
|
556
|
+
// https://eslint.org/docs/latest/rules/no-ternary
|
|
557
|
+
'no-ternary': 'off',
|
|
558
|
+
|
|
559
|
+
// https://eslint.org/docs/latest/rules/no-throw-literal
|
|
560
|
+
'no-throw-literal': 'error',
|
|
561
|
+
|
|
562
|
+
// https://eslint.org/docs/latest/rules/no-undef-init
|
|
563
|
+
'no-undef-init': 'error',
|
|
564
|
+
|
|
565
|
+
// https://eslint.org/docs/latest/rules/no-undefined
|
|
566
|
+
'no-undefined': 'off',
|
|
567
|
+
|
|
568
|
+
// https://eslint.org/docs/latest/rules/no-underscore-dangle
|
|
569
|
+
'no-underscore-dangle': 'off',
|
|
570
|
+
|
|
571
|
+
// https://eslint.org/docs/latest/rules/no-unused-expressions
|
|
572
|
+
'no-unneeded-ternary': ['error', { defaultAssignment: false }],
|
|
573
|
+
|
|
574
|
+
// https://eslint.org/docs/latest/rules/no-unused-expressions
|
|
575
|
+
'no-unused-expressions': [
|
|
576
|
+
'error',
|
|
577
|
+
{
|
|
578
|
+
enforceForJSX: true,
|
|
579
|
+
},
|
|
580
|
+
],
|
|
581
|
+
|
|
582
|
+
// https://eslint.org/docs/latest/rules/no-unused-labels
|
|
583
|
+
'no-unused-labels': 'error',
|
|
584
|
+
|
|
585
|
+
// https://eslint.org/docs/latest/rules/no-useless-call
|
|
586
|
+
'no-useless-call': 'error',
|
|
587
|
+
|
|
588
|
+
// https://eslint.org/docs/latest/rules/no-useless-catch
|
|
589
|
+
'no-useless-catch': 'error',
|
|
590
|
+
|
|
591
|
+
// https://eslint.org/docs/latest/rules/no-useless-constructor
|
|
592
|
+
'no-useless-constructor': 'error',
|
|
593
|
+
|
|
594
|
+
// https://eslint.org/docs/latest/rules/no-useless-escape
|
|
595
|
+
'no-useless-escape': 'error',
|
|
596
|
+
|
|
597
|
+
// https://eslint.org/docs/latest/rules/no-useless-rename
|
|
598
|
+
'no-useless-rename': [
|
|
599
|
+
'error',
|
|
600
|
+
{
|
|
601
|
+
ignoreDestructuring: false,
|
|
602
|
+
ignoreImport: false,
|
|
603
|
+
ignoreExport: false,
|
|
604
|
+
},
|
|
605
|
+
],
|
|
606
|
+
|
|
607
|
+
// https://eslint.org/docs/latest/rules/no-useless-return
|
|
608
|
+
'no-useless-return': 'error',
|
|
609
|
+
|
|
610
|
+
// https://eslint.org/docs/latest/rules/no-var
|
|
611
|
+
'no-var': 'error',
|
|
612
|
+
|
|
613
|
+
// https://eslint.org/docs/latest/rules/no-void
|
|
614
|
+
'no-void': 'error',
|
|
615
|
+
|
|
616
|
+
// https://eslint.org/docs/latest/rules/no-warning-comments
|
|
617
|
+
'no-warning-comments': 'off',
|
|
618
|
+
|
|
619
|
+
// https://eslint.org/docs/latest/rules/no-with
|
|
620
|
+
'no-with': 'error',
|
|
621
|
+
|
|
622
|
+
// https://eslint.org/docs/latest/rules/object-shorthand
|
|
623
|
+
'object-shorthand': 'error',
|
|
624
|
+
|
|
625
|
+
// https://eslint.org/docs/latest/rules/one-var
|
|
626
|
+
'one-var': ['error', 'never'],
|
|
627
|
+
|
|
628
|
+
// https://eslint.org/docs/latest/rules/operator-assignment
|
|
629
|
+
'operator-assignment': ['error', 'always'],
|
|
630
|
+
|
|
631
|
+
// https://eslint.org/docs/latest/rules/prefer-arrow-callback
|
|
632
|
+
'prefer-arrow-callback': [
|
|
633
|
+
'error',
|
|
634
|
+
{
|
|
635
|
+
allowNamedFunctions: false,
|
|
636
|
+
allowUnboundThis: true,
|
|
637
|
+
},
|
|
638
|
+
],
|
|
639
|
+
|
|
640
|
+
// https://eslint.org/docs/latest/rules/prefer-const
|
|
641
|
+
'prefer-const': [
|
|
642
|
+
'error',
|
|
643
|
+
{
|
|
644
|
+
destructuring: 'all',
|
|
645
|
+
ignoreReadBeforeAssign: false,
|
|
646
|
+
},
|
|
647
|
+
],
|
|
648
|
+
|
|
649
|
+
// https://eslint.org/docs/latest/rules/prefer-destructuring
|
|
650
|
+
'prefer-destructuring': [
|
|
651
|
+
'error',
|
|
652
|
+
{
|
|
653
|
+
VariableDeclarator: {
|
|
654
|
+
array: true,
|
|
655
|
+
object: true,
|
|
656
|
+
},
|
|
657
|
+
AssignmentExpression: {
|
|
658
|
+
array: true,
|
|
659
|
+
object: true,
|
|
660
|
+
},
|
|
661
|
+
},
|
|
662
|
+
{
|
|
663
|
+
enforceForRenamedProperties: false,
|
|
664
|
+
},
|
|
665
|
+
],
|
|
666
|
+
|
|
667
|
+
// https://eslint.org/docs/latest/rules/prefer-exponentiation-operator
|
|
668
|
+
'prefer-exponentiation-operator': 'error',
|
|
669
|
+
|
|
670
|
+
// https://eslint.org/docs/latest/rules/prefer-named-capture-group
|
|
671
|
+
'prefer-named-capture-group': 'off',
|
|
672
|
+
|
|
673
|
+
// https://eslint.org/docs/latest/rules/prefer-numeric-literals
|
|
674
|
+
'prefer-numeric-literals': 'error',
|
|
675
|
+
|
|
676
|
+
// https://eslint.org/docs/latest/rules/prefer-object-has-own
|
|
677
|
+
'prefer-object-has-own': 'error',
|
|
678
|
+
|
|
679
|
+
// https://eslint.org/docs/latest/rules/prefer-object-spread
|
|
680
|
+
'prefer-object-spread': 'error',
|
|
681
|
+
|
|
682
|
+
// https://eslint.org/docs/latest/rules/prefer-promise-reject-errors
|
|
683
|
+
'prefer-promise-reject-errors': ['error', { allowEmptyReject: false }],
|
|
684
|
+
|
|
685
|
+
// https://eslint.org/docs/latest/rules/prefer-regex-literals
|
|
686
|
+
'prefer-regex-literals': [
|
|
687
|
+
'error',
|
|
688
|
+
{
|
|
689
|
+
disallowRedundantWrapping: true,
|
|
690
|
+
},
|
|
691
|
+
],
|
|
692
|
+
|
|
693
|
+
// https://eslint.org/docs/latest/rules/prefer-rest-params
|
|
694
|
+
'prefer-rest-params': 'error',
|
|
695
|
+
|
|
696
|
+
// https://eslint.org/docs/latest/rules/prefer-spread
|
|
697
|
+
'prefer-spread': 'error',
|
|
698
|
+
|
|
699
|
+
// https://eslint.org/docs/latest/rules/prefer-template
|
|
700
|
+
'prefer-template': 'error',
|
|
701
|
+
|
|
702
|
+
// https://eslint.org/docs/latest/rules/preserve-caught-error
|
|
703
|
+
'preserve-caught-error': ['error', { requireCatchParameter: true }],
|
|
704
|
+
|
|
705
|
+
// https://eslint.org/docs/latest/rules/radix
|
|
706
|
+
radix: ['error', 'as-needed'],
|
|
707
|
+
|
|
708
|
+
// https://eslint.org/docs/latest/rules/require-await
|
|
709
|
+
'require-await': 'off',
|
|
710
|
+
|
|
711
|
+
// https://eslint.org/docs/latest/rules/require-unicode-regexp
|
|
712
|
+
'require-unicode-regexp': 'off',
|
|
713
|
+
|
|
714
|
+
// https://eslint.org/docs/latest/rules/require-yield
|
|
715
|
+
'require-yield': 'error',
|
|
716
|
+
|
|
717
|
+
// https://eslint.org/docs/latest/rules/sort-imports
|
|
718
|
+
'sort-imports': 'off', // handled by import/order
|
|
719
|
+
|
|
720
|
+
// https://eslint.org/docs/latest/rules/sort-keys
|
|
721
|
+
'sort-keys': [
|
|
722
|
+
'off', // maybe enable this in the future
|
|
723
|
+
'asc',
|
|
724
|
+
{
|
|
725
|
+
caseSensitive: false,
|
|
726
|
+
natural: false,
|
|
727
|
+
minKeys: 2,
|
|
728
|
+
allowLineSeparatedGroups: true,
|
|
729
|
+
ignoreComputedKeys: true,
|
|
730
|
+
},
|
|
731
|
+
],
|
|
732
|
+
|
|
733
|
+
// https://eslint.org/docs/latest/rules/sort-vars
|
|
734
|
+
'sort-vars': 'off',
|
|
735
|
+
|
|
736
|
+
// https://eslint.org/docs/latest/rules/strict
|
|
737
|
+
strict: ['error', 'never'],
|
|
738
|
+
|
|
739
|
+
// https://eslint.org/docs/latest/rules/symbol-description
|
|
740
|
+
'symbol-description': 'error',
|
|
741
|
+
|
|
742
|
+
// https://eslint.org/docs/latest/rules/vars-on-top
|
|
743
|
+
'vars-on-top': 'error',
|
|
744
|
+
|
|
745
|
+
// https://eslint.org/docs/latest/rules/yoda
|
|
746
|
+
yoda: ['error', 'never'],
|
|
747
|
+
|
|
748
|
+
// https://eslint.org/docs/latest/rules/unicode-bom
|
|
749
|
+
'unicode-bom': ['error', 'never'],
|
|
750
|
+
};
|
|
751
|
+
};
|
|
752
|
+
|
|
753
|
+
export default getBaseRules;
|