@wistia/oxlint-config 0.2.0 → 0.3.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/configs/javascript.mjs +13 -0
- package/configs/node.mjs +8 -0
- package/configs/playwright.mjs +7 -0
- package/configs/react.mjs +11 -0
- package/configs/storybook.mjs +7 -0
- package/configs/styled-components.mjs +7 -0
- package/configs/testing-library.mjs +7 -0
- package/configs/typescript.mjs +20 -0
- package/configs/vitest.mjs +8 -0
- package/index.mjs +24 -0
- package/package.json +10 -16
- package/rules/{base.jsonc → base.mjs} +179 -184
- package/rules/{import.jsonc → import.mjs} +30 -32
- package/rules/{node.jsonc → node.mjs} +37 -39
- package/rules/{playwright.jsonc → playwright.mjs} +52 -54
- package/rules/{promise.jsonc → promise.mjs} +20 -22
- package/rules/{react-a11y.jsonc → react-a11y.mjs} +48 -50
- package/rules/{react.jsonc → react.mjs} +55 -57
- package/rules/{storybook.jsonc → storybook.mjs} +20 -22
- package/rules/styled-components.mjs +151 -0
- package/rules/{testing-library.jsonc → testing-library.mjs} +48 -50
- package/rules/{typescript.jsonc → typescript.mjs} +134 -136
- package/rules/{vitest.jsonc → vitest.mjs} +87 -89
- package/configs/javascript.jsonc +0 -4
- package/configs/node.jsonc +0 -4
- package/configs/playwright.jsonc +0 -4
- package/configs/react.jsonc +0 -4
- package/configs/storybook.jsonc +0 -4
- package/configs/styled-components.jsonc +0 -4
- package/configs/testing-library.jsonc +0 -4
- package/configs/typescript.jsonc +0 -4
- package/configs/vitest.jsonc +0 -4
- package/jsoncLoader.d.mts +0 -10
- package/jsoncLoader.mjs +0 -27
- package/rules/styled-components.jsonc +0 -153
|
@@ -1,636 +1,631 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
"categories": {},
|
|
5
|
-
"rules": {
|
|
1
|
+
export const baseRules = {
|
|
2
|
+
plugins: ['eslint', 'oxc'],
|
|
3
|
+
rules: {
|
|
6
4
|
// -- Possible Problems (Correctness) --
|
|
7
5
|
|
|
8
6
|
// Enforce return statements in callbacks of array methods
|
|
9
7
|
// https://eslint.org/docs/rules/array-callback-return
|
|
10
|
-
|
|
8
|
+
'eslint/array-callback-return': ['error', { allowImplicit: true }],
|
|
11
9
|
|
|
12
10
|
// Require super() calls in constructors
|
|
13
11
|
// https://eslint.org/docs/rules/constructor-super
|
|
14
|
-
|
|
12
|
+
'eslint/constructor-super': 'error',
|
|
15
13
|
|
|
16
14
|
// Enforce for loop update clause moving the counter in the right direction
|
|
17
15
|
// https://eslint.org/docs/rules/for-direction
|
|
18
|
-
|
|
16
|
+
'eslint/for-direction': 'error',
|
|
19
17
|
|
|
20
18
|
// Disallow using an async function as a Promise executor
|
|
21
19
|
// https://eslint.org/docs/rules/no-async-promise-executor
|
|
22
|
-
|
|
20
|
+
'eslint/no-async-promise-executor': 'error',
|
|
23
21
|
|
|
24
22
|
// Disallow await inside of loops
|
|
25
23
|
// https://eslint.org/docs/rules/no-await-in-loop
|
|
26
|
-
|
|
24
|
+
'eslint/no-await-in-loop': 'error',
|
|
27
25
|
|
|
28
26
|
// Disallow reassigning class members
|
|
29
27
|
// https://eslint.org/docs/rules/no-class-assign
|
|
30
|
-
|
|
28
|
+
'eslint/no-class-assign': 'error',
|
|
31
29
|
|
|
32
30
|
// Disallow comparing against -0
|
|
33
31
|
// https://eslint.org/docs/rules/no-compare-neg-zero
|
|
34
|
-
|
|
32
|
+
'eslint/no-compare-neg-zero': 'error',
|
|
35
33
|
|
|
36
34
|
// Disallow assignment operators in conditional expressions
|
|
37
35
|
// https://eslint.org/docs/rules/no-cond-assign
|
|
38
|
-
|
|
36
|
+
'eslint/no-cond-assign': ['error', 'always'],
|
|
39
37
|
|
|
40
38
|
// Disallow reassigning const variables
|
|
41
39
|
// https://eslint.org/docs/rules/no-const-assign
|
|
42
|
-
|
|
40
|
+
'eslint/no-const-assign': 'error',
|
|
43
41
|
|
|
44
42
|
// Disallow expressions where the operation doesn't affect the value
|
|
45
43
|
// https://eslint.org/docs/rules/no-constant-binary-expression
|
|
46
|
-
|
|
44
|
+
'eslint/no-constant-binary-expression': 'error',
|
|
47
45
|
|
|
48
46
|
// Disallow constant expressions in conditions
|
|
49
47
|
// https://eslint.org/docs/rules/no-constant-condition
|
|
50
|
-
|
|
48
|
+
'eslint/no-constant-condition': 'error',
|
|
51
49
|
|
|
52
50
|
// Disallow returning value from constructor
|
|
53
51
|
// https://eslint.org/docs/rules/no-constructor-return
|
|
54
|
-
|
|
52
|
+
'eslint/no-constructor-return': 'error',
|
|
55
53
|
|
|
56
54
|
// Disallow control characters in regular expressions
|
|
57
55
|
// https://eslint.org/docs/rules/no-control-regex
|
|
58
|
-
|
|
56
|
+
'eslint/no-control-regex': 'error',
|
|
59
57
|
|
|
60
58
|
// Disallow the use of debugger
|
|
61
59
|
// https://eslint.org/docs/rules/no-debugger
|
|
62
|
-
|
|
60
|
+
'eslint/no-debugger': 'error',
|
|
63
61
|
|
|
64
62
|
// Disallow duplicate class members
|
|
65
63
|
// https://eslint.org/docs/rules/no-dupe-class-members
|
|
66
|
-
|
|
64
|
+
'eslint/no-dupe-class-members': 'error',
|
|
67
65
|
|
|
68
66
|
// Disallow duplicate conditions in if-else-if chains
|
|
69
67
|
// https://eslint.org/docs/rules/no-dupe-else-if
|
|
70
|
-
|
|
68
|
+
'eslint/no-dupe-else-if': 'error',
|
|
71
69
|
|
|
72
70
|
// Disallow duplicate keys in object literals
|
|
73
71
|
// https://eslint.org/docs/rules/no-dupe-keys
|
|
74
|
-
|
|
72
|
+
'eslint/no-dupe-keys': 'error',
|
|
75
73
|
|
|
76
74
|
// Disallow duplicate case labels
|
|
77
75
|
// https://eslint.org/docs/rules/no-duplicate-case
|
|
78
|
-
|
|
76
|
+
'eslint/no-duplicate-case': 'error',
|
|
79
77
|
|
|
80
78
|
// Disallow empty character classes in regular expressions
|
|
81
79
|
// https://eslint.org/docs/rules/no-empty-character-class
|
|
82
|
-
|
|
80
|
+
'eslint/no-empty-character-class': 'error',
|
|
83
81
|
|
|
84
82
|
// Disallow empty destructuring patterns
|
|
85
83
|
// https://eslint.org/docs/rules/no-empty-pattern
|
|
86
|
-
|
|
84
|
+
'eslint/no-empty-pattern': 'error',
|
|
87
85
|
|
|
88
86
|
// Disallow reassigning exceptions in catch clauses
|
|
89
87
|
// https://eslint.org/docs/rules/no-ex-assign
|
|
90
|
-
|
|
88
|
+
'eslint/no-ex-assign': 'error',
|
|
91
89
|
|
|
92
90
|
// Disallow fallthrough of case statements
|
|
93
91
|
// https://eslint.org/docs/rules/no-fallthrough
|
|
94
|
-
|
|
92
|
+
'eslint/no-fallthrough': 'error',
|
|
95
93
|
|
|
96
94
|
// Disallow reassigning function declarations
|
|
97
95
|
// https://eslint.org/docs/rules/no-func-assign
|
|
98
|
-
|
|
96
|
+
'eslint/no-func-assign': 'error',
|
|
99
97
|
|
|
100
98
|
// Disallow assigning to imported bindings
|
|
101
99
|
// https://eslint.org/docs/rules/no-import-assign
|
|
102
|
-
|
|
100
|
+
'eslint/no-import-assign': 'error',
|
|
103
101
|
|
|
104
102
|
// Disallow variable or function declarations in nested blocks
|
|
105
103
|
// https://eslint.org/docs/rules/no-inner-declarations
|
|
106
|
-
|
|
104
|
+
'eslint/no-inner-declarations': 'error',
|
|
107
105
|
|
|
108
106
|
// Disallow invalid regular expression strings in RegExp constructors
|
|
109
107
|
// https://eslint.org/docs/rules/no-invalid-regexp
|
|
110
|
-
|
|
108
|
+
'eslint/no-invalid-regexp': 'error',
|
|
111
109
|
|
|
112
110
|
// Disallow irregular whitespace
|
|
113
111
|
// https://eslint.org/docs/rules/no-irregular-whitespace
|
|
114
|
-
|
|
112
|
+
'eslint/no-irregular-whitespace': 'error',
|
|
115
113
|
|
|
116
114
|
// Disallow literal numbers that lose precision
|
|
117
115
|
// https://eslint.org/docs/rules/no-loss-of-precision
|
|
118
|
-
|
|
116
|
+
'eslint/no-loss-of-precision': 'error',
|
|
119
117
|
|
|
120
118
|
// Disallow characters which are made with multiple code points in character class syntax
|
|
121
119
|
// https://eslint.org/docs/rules/no-misleading-character-class
|
|
122
|
-
|
|
120
|
+
'eslint/no-misleading-character-class': 'error',
|
|
123
121
|
|
|
124
122
|
// Disallow new operators with global non-constructor functions
|
|
125
123
|
// https://eslint.org/docs/rules/no-new-native-nonconstructor
|
|
126
|
-
|
|
124
|
+
'eslint/no-new-native-nonconstructor': 'error',
|
|
127
125
|
|
|
128
126
|
// Disallow calling global object properties as functions
|
|
129
127
|
// https://eslint.org/docs/rules/no-obj-calls
|
|
130
|
-
|
|
128
|
+
'eslint/no-obj-calls': 'error',
|
|
131
129
|
|
|
132
130
|
// Disallow returning values from Promise executor functions
|
|
133
131
|
// https://eslint.org/docs/rules/no-promise-executor-return
|
|
134
|
-
|
|
132
|
+
'eslint/no-promise-executor-return': 'error',
|
|
135
133
|
|
|
136
134
|
// Disallow calling some Object.prototype methods directly on objects
|
|
137
135
|
// https://eslint.org/docs/rules/no-prototype-builtins
|
|
138
|
-
|
|
136
|
+
'eslint/no-prototype-builtins': 'error',
|
|
139
137
|
|
|
140
138
|
// Disallow assignments where both sides are exactly the same
|
|
141
139
|
// https://eslint.org/docs/rules/no-self-assign
|
|
142
|
-
|
|
140
|
+
'eslint/no-self-assign': 'error',
|
|
143
141
|
|
|
144
142
|
// Disallow comparisons where both sides are exactly the same
|
|
145
143
|
// https://eslint.org/docs/rules/no-self-compare
|
|
146
|
-
|
|
144
|
+
'eslint/no-self-compare': 'error',
|
|
147
145
|
|
|
148
146
|
// Disallow returning values from setters
|
|
149
147
|
// https://eslint.org/docs/rules/no-setter-return
|
|
150
|
-
|
|
148
|
+
'eslint/no-setter-return': 'error',
|
|
151
149
|
|
|
152
150
|
// Disallow sparse arrays
|
|
153
151
|
// https://eslint.org/docs/rules/no-sparse-arrays
|
|
154
|
-
|
|
152
|
+
'eslint/no-sparse-arrays': 'error',
|
|
155
153
|
|
|
156
154
|
// Disallow template literal placeholder syntax in regular strings
|
|
157
155
|
// https://eslint.org/docs/rules/no-template-curly-in-string
|
|
158
|
-
|
|
156
|
+
'eslint/no-template-curly-in-string': 'error',
|
|
159
157
|
|
|
160
158
|
// Disallow this/super before calling super() in constructors
|
|
161
159
|
// https://eslint.org/docs/rules/no-this-before-super
|
|
162
|
-
|
|
160
|
+
'eslint/no-this-before-super': 'error',
|
|
163
161
|
|
|
164
162
|
// Disallow let or var variables that are read but never assigned
|
|
165
163
|
// https://eslint.org/docs/rules/no-unassigned-vars
|
|
166
|
-
|
|
164
|
+
'eslint/no-unassigned-vars': 'error',
|
|
167
165
|
|
|
168
166
|
// Disallow unmodified loop conditions
|
|
169
167
|
// https://eslint.org/docs/rules/no-unmodified-loop-condition
|
|
170
|
-
|
|
168
|
+
'eslint/no-unmodified-loop-condition': 'error',
|
|
171
169
|
|
|
172
170
|
// Disallow control flow statements in finally blocks
|
|
173
171
|
// https://eslint.org/docs/rules/no-unsafe-finally
|
|
174
|
-
|
|
172
|
+
'eslint/no-unsafe-finally': 'error',
|
|
175
173
|
|
|
176
174
|
// Disallow negating the left operand of relational operators
|
|
177
175
|
// https://eslint.org/docs/rules/no-unsafe-negation
|
|
178
|
-
|
|
176
|
+
'eslint/no-unsafe-negation': 'error',
|
|
179
177
|
|
|
180
178
|
// Disallow use of optional chaining in contexts where the undefined value is not allowed
|
|
181
179
|
// https://eslint.org/docs/rules/no-unsafe-optional-chaining
|
|
182
|
-
|
|
180
|
+
'eslint/no-unsafe-optional-chaining': ['error', { disallowArithmeticOperators: true }],
|
|
183
181
|
|
|
184
182
|
// Disallow unused private class members
|
|
185
183
|
// https://eslint.org/docs/rules/no-unused-private-class-members
|
|
186
|
-
|
|
184
|
+
'eslint/no-unused-private-class-members': 'error',
|
|
187
185
|
|
|
188
186
|
// Disallow unused variables
|
|
189
187
|
// https://eslint.org/docs/rules/no-unused-vars
|
|
190
|
-
|
|
191
|
-
|
|
188
|
+
'eslint/no-unused-vars': [
|
|
189
|
+
'error',
|
|
192
190
|
{
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
191
|
+
vars: 'all',
|
|
192
|
+
args: 'after-used',
|
|
193
|
+
argsIgnorePattern: '^_',
|
|
194
|
+
caughtErrors: 'all',
|
|
195
|
+
caughtErrorsIgnorePattern: '^_',
|
|
196
|
+
destructuredArrayIgnorePattern: '^_',
|
|
197
|
+
ignoreRestSiblings: true,
|
|
198
|
+
varsIgnorePattern: '^_',
|
|
201
199
|
},
|
|
202
200
|
],
|
|
203
201
|
|
|
204
202
|
// Disallow the use of variables before they are defined
|
|
205
203
|
// https://eslint.org/docs/rules/no-use-before-define
|
|
206
|
-
|
|
207
|
-
"error",
|
|
208
|
-
{ "functions": true, "classes": true, "variables": true },
|
|
209
|
-
],
|
|
204
|
+
'eslint/no-use-before-define': ['error', { functions: true, classes: true, variables: true }],
|
|
210
205
|
|
|
211
206
|
// Disallow useless backreferences in regular expressions
|
|
212
207
|
// https://eslint.org/docs/rules/no-useless-backreference
|
|
213
|
-
|
|
208
|
+
'eslint/no-useless-backreference': 'error',
|
|
214
209
|
|
|
215
210
|
// Require calls to isNaN() when checking for NaN
|
|
216
211
|
// https://eslint.org/docs/rules/use-isnan
|
|
217
|
-
|
|
212
|
+
'eslint/use-isnan': 'error',
|
|
218
213
|
|
|
219
214
|
// Enforce comparing typeof expressions against valid strings
|
|
220
215
|
// https://eslint.org/docs/rules/valid-typeof
|
|
221
|
-
|
|
216
|
+
'eslint/valid-typeof': ['error', { requireStringLiterals: true }],
|
|
222
217
|
|
|
223
218
|
// -- Suggestions --
|
|
224
219
|
|
|
225
220
|
// Enforce getter and setter pairs in objects and classes
|
|
226
221
|
// https://eslint.org/docs/rules/accessor-pairs
|
|
227
|
-
|
|
222
|
+
'eslint/accessor-pairs': 'error',
|
|
228
223
|
|
|
229
224
|
// Enforce the use of variables within the scope they are defined
|
|
230
225
|
// https://eslint.org/docs/rules/block-scoped-var
|
|
231
|
-
|
|
226
|
+
'eslint/block-scoped-var': 'error',
|
|
232
227
|
|
|
233
228
|
// Enforce default clauses in switch statements to be last
|
|
234
229
|
// https://eslint.org/docs/rules/default-case-last
|
|
235
|
-
|
|
230
|
+
'eslint/default-case-last': 'error',
|
|
236
231
|
|
|
237
232
|
// Enforce default parameters to be last
|
|
238
233
|
// https://eslint.org/docs/rules/default-param-last
|
|
239
|
-
|
|
234
|
+
'eslint/default-param-last': 'error',
|
|
240
235
|
|
|
241
236
|
// Require the use of === and !==
|
|
242
237
|
// https://eslint.org/docs/rules/eqeqeq
|
|
243
|
-
|
|
238
|
+
'eslint/eqeqeq': ['error', 'always', { null: 'ignore' }],
|
|
244
239
|
|
|
245
240
|
// Require for-in loops to include an if statement
|
|
246
241
|
// https://eslint.org/docs/rules/guard-for-in
|
|
247
|
-
|
|
242
|
+
'eslint/guard-for-in': 'error',
|
|
248
243
|
|
|
249
244
|
// Enforce minimum and maximum identifier lengths
|
|
250
245
|
// https://eslint.org/docs/rules/id-length
|
|
251
|
-
|
|
252
|
-
|
|
246
|
+
'eslint/id-length': [
|
|
247
|
+
'error',
|
|
253
248
|
{
|
|
254
|
-
|
|
255
|
-
|
|
249
|
+
min: 2,
|
|
250
|
+
exceptions: ['_', 'i', 'j', 'x', 'y'],
|
|
256
251
|
},
|
|
257
252
|
],
|
|
258
253
|
|
|
259
254
|
// Enforce a maximum number of classes per file
|
|
260
255
|
// https://eslint.org/docs/rules/max-classes-per-file
|
|
261
|
-
|
|
256
|
+
'eslint/max-classes-per-file': ['error', 1],
|
|
262
257
|
|
|
263
258
|
// Disallow the use of alert, confirm, and prompt
|
|
264
259
|
// https://eslint.org/docs/rules/no-alert
|
|
265
|
-
|
|
260
|
+
'eslint/no-alert': 'error',
|
|
266
261
|
|
|
267
262
|
// Disallow Array constructors
|
|
268
263
|
// https://eslint.org/docs/rules/no-array-constructor
|
|
269
|
-
|
|
264
|
+
'eslint/no-array-constructor': 'error',
|
|
270
265
|
|
|
271
266
|
// Disallow bitwise operators
|
|
272
267
|
// https://eslint.org/docs/rules/no-bitwise
|
|
273
|
-
|
|
268
|
+
'eslint/no-bitwise': 'error',
|
|
274
269
|
|
|
275
270
|
// Disallow the use of arguments.caller or arguments.callee
|
|
276
271
|
// https://eslint.org/docs/rules/no-caller
|
|
277
|
-
|
|
272
|
+
'eslint/no-caller': 'error',
|
|
278
273
|
|
|
279
274
|
// Disallow lexical declarations in case clauses
|
|
280
275
|
// https://eslint.org/docs/rules/no-case-declarations
|
|
281
|
-
|
|
276
|
+
'eslint/no-case-declarations': 'error',
|
|
282
277
|
|
|
283
278
|
// Disallow the use of console
|
|
284
279
|
// https://eslint.org/docs/rules/no-console
|
|
285
|
-
|
|
280
|
+
'eslint/no-console': 'error',
|
|
286
281
|
|
|
287
282
|
// Disallow continue statements
|
|
288
283
|
// https://eslint.org/docs/rules/no-continue
|
|
289
|
-
|
|
284
|
+
'eslint/no-continue': 'error',
|
|
290
285
|
|
|
291
286
|
// Disallow deleting variables
|
|
292
287
|
// https://eslint.org/docs/rules/no-delete-var
|
|
293
|
-
|
|
288
|
+
'eslint/no-delete-var': 'error',
|
|
294
289
|
|
|
295
290
|
// Disallow else blocks after return statements in if statements
|
|
296
291
|
// https://eslint.org/docs/rules/no-else-return
|
|
297
|
-
|
|
292
|
+
'eslint/no-else-return': ['error', { allowElseIf: false }],
|
|
298
293
|
|
|
299
294
|
// Disallow empty block statements
|
|
300
295
|
// https://eslint.org/docs/rules/no-empty
|
|
301
|
-
|
|
296
|
+
'eslint/no-empty': 'error',
|
|
302
297
|
|
|
303
298
|
// Disallow empty functions
|
|
304
299
|
// https://eslint.org/docs/rules/no-empty-function
|
|
305
|
-
|
|
300
|
+
'eslint/no-empty-function': ['error', { allow: ['arrowFunctions', 'functions', 'methods'] }],
|
|
306
301
|
|
|
307
302
|
// Disallow empty static blocks
|
|
308
303
|
// https://eslint.org/docs/rules/no-empty-static-block
|
|
309
|
-
|
|
304
|
+
'eslint/no-empty-static-block': 'error',
|
|
310
305
|
|
|
311
306
|
// Disallow the use of eval()
|
|
312
307
|
// https://eslint.org/docs/rules/no-eval
|
|
313
|
-
|
|
308
|
+
'eslint/no-eval': 'error',
|
|
314
309
|
|
|
315
310
|
// Disallow extending native types
|
|
316
311
|
// https://eslint.org/docs/rules/no-extend-native
|
|
317
|
-
|
|
312
|
+
'eslint/no-extend-native': 'error',
|
|
318
313
|
|
|
319
314
|
// Disallow unnecessary calls to .bind()
|
|
320
315
|
// https://eslint.org/docs/rules/no-extra-bind
|
|
321
|
-
|
|
316
|
+
'eslint/no-extra-bind': 'error',
|
|
322
317
|
|
|
323
318
|
// Disallow unnecessary boolean casts
|
|
324
319
|
// https://eslint.org/docs/rules/no-extra-boolean-cast
|
|
325
|
-
|
|
320
|
+
'eslint/no-extra-boolean-cast': 'error',
|
|
326
321
|
|
|
327
322
|
// Disallow unnecessary labels
|
|
328
323
|
// https://eslint.org/docs/rules/no-extra-label
|
|
329
|
-
|
|
324
|
+
'eslint/no-extra-label': 'error',
|
|
330
325
|
|
|
331
326
|
// Disallow assignments to native objects or read-only global variables
|
|
332
327
|
// https://eslint.org/docs/rules/no-global-assign
|
|
333
|
-
|
|
328
|
+
'eslint/no-global-assign': 'error',
|
|
334
329
|
|
|
335
330
|
// Disallow shorthand type conversions
|
|
336
331
|
// https://eslint.org/docs/rules/no-implicit-coercion
|
|
337
|
-
|
|
332
|
+
'eslint/no-implicit-coercion': 'error',
|
|
338
333
|
|
|
339
334
|
// Disallow the use of the __iterator__ property
|
|
340
335
|
// https://eslint.org/docs/rules/no-iterator
|
|
341
|
-
|
|
336
|
+
'eslint/no-iterator': 'error',
|
|
342
337
|
|
|
343
338
|
// Disallow labels that share a name with a variable
|
|
344
339
|
// https://eslint.org/docs/rules/no-label-var
|
|
345
|
-
|
|
340
|
+
'eslint/no-label-var': 'error',
|
|
346
341
|
|
|
347
342
|
// Disallow labeled statements
|
|
348
343
|
// https://eslint.org/docs/rules/no-labels
|
|
349
|
-
|
|
344
|
+
'eslint/no-labels': 'error',
|
|
350
345
|
|
|
351
346
|
// Disallow unnecessary nested blocks
|
|
352
347
|
// https://eslint.org/docs/rules/no-lone-blocks
|
|
353
|
-
|
|
348
|
+
'eslint/no-lone-blocks': 'error',
|
|
354
349
|
|
|
355
350
|
// Disallow if statements as the only statement in else blocks
|
|
356
351
|
// https://eslint.org/docs/rules/no-lonely-if
|
|
357
|
-
|
|
352
|
+
'eslint/no-lonely-if': 'error',
|
|
358
353
|
|
|
359
354
|
// Disallow function declarations that contain unsafe references inside loop statements
|
|
360
355
|
// https://eslint.org/docs/rules/no-loop-func
|
|
361
|
-
|
|
356
|
+
'eslint/no-loop-func': 'error',
|
|
362
357
|
|
|
363
358
|
// Disallow use of chained assignment expressions
|
|
364
359
|
// https://eslint.org/docs/rules/no-multi-assign
|
|
365
|
-
|
|
360
|
+
'eslint/no-multi-assign': 'error',
|
|
366
361
|
|
|
367
362
|
// Disallow multiline strings
|
|
368
363
|
// https://eslint.org/docs/rules/no-multi-str
|
|
369
|
-
|
|
364
|
+
'eslint/no-multi-str': 'error',
|
|
370
365
|
|
|
371
366
|
// Disallow nested ternary expressions
|
|
372
367
|
// https://eslint.org/docs/rules/no-nested-ternary
|
|
373
|
-
|
|
368
|
+
'eslint/no-nested-ternary': 'error',
|
|
374
369
|
|
|
375
370
|
// Disallow new operators outside of assignments or comparisons
|
|
376
371
|
// https://eslint.org/docs/rules/no-new
|
|
377
|
-
|
|
372
|
+
'eslint/no-new': 'error',
|
|
378
373
|
|
|
379
374
|
// Disallow new operators with the Function object
|
|
380
375
|
// https://eslint.org/docs/rules/no-new-func
|
|
381
|
-
|
|
376
|
+
'eslint/no-new-func': 'error',
|
|
382
377
|
|
|
383
378
|
// Disallow new operators with the String, Number, and Boolean objects
|
|
384
379
|
// https://eslint.org/docs/rules/no-new-wrappers
|
|
385
|
-
|
|
380
|
+
'eslint/no-new-wrappers': 'error',
|
|
386
381
|
|
|
387
382
|
// Disallow \8 and \9 escape sequences in string literals
|
|
388
383
|
// https://eslint.org/docs/rules/no-nonoctal-decimal-escape
|
|
389
|
-
|
|
384
|
+
'eslint/no-nonoctal-decimal-escape': 'error',
|
|
390
385
|
|
|
391
386
|
// Disallow calls to the Object constructor without an argument
|
|
392
387
|
// https://eslint.org/docs/rules/no-object-constructor
|
|
393
|
-
|
|
388
|
+
'eslint/no-object-constructor': 'error',
|
|
394
389
|
|
|
395
390
|
// Disallow reassigning function parameters
|
|
396
391
|
// https://eslint.org/docs/rules/no-param-reassign
|
|
397
|
-
|
|
398
|
-
|
|
392
|
+
'eslint/no-param-reassign': [
|
|
393
|
+
'error',
|
|
399
394
|
{
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
395
|
+
props: true,
|
|
396
|
+
ignorePropertyModificationsFor: [
|
|
397
|
+
'acc',
|
|
398
|
+
'accumulator',
|
|
399
|
+
'e',
|
|
400
|
+
'ctx',
|
|
401
|
+
'context',
|
|
402
|
+
'req',
|
|
403
|
+
'request',
|
|
404
|
+
'res',
|
|
405
|
+
'response',
|
|
406
|
+
'$scope',
|
|
407
|
+
'staticContext',
|
|
413
408
|
],
|
|
414
409
|
},
|
|
415
410
|
],
|
|
416
411
|
|
|
417
412
|
// Disallow the unary operators ++ and --
|
|
418
413
|
// https://eslint.org/docs/rules/no-plusplus
|
|
419
|
-
|
|
414
|
+
'eslint/no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
|
|
420
415
|
|
|
421
416
|
// Disallow the use of the __proto__ property
|
|
422
417
|
// https://eslint.org/docs/rules/no-proto
|
|
423
|
-
|
|
418
|
+
'eslint/no-proto': 'error',
|
|
424
419
|
|
|
425
420
|
// Disallow variable redeclaration
|
|
426
421
|
// https://eslint.org/docs/rules/no-redeclare
|
|
427
|
-
|
|
422
|
+
'eslint/no-redeclare': 'error',
|
|
428
423
|
|
|
429
424
|
// Disallow multiple spaces in regular expressions
|
|
430
425
|
// https://eslint.org/docs/rules/no-regex-spaces
|
|
431
|
-
|
|
426
|
+
'eslint/no-regex-spaces': 'error',
|
|
432
427
|
|
|
433
428
|
// Disallow assignment operators in return statements
|
|
434
429
|
// https://eslint.org/docs/rules/no-return-assign
|
|
435
|
-
|
|
430
|
+
'eslint/no-return-assign': ['error', 'always'],
|
|
436
431
|
|
|
437
432
|
// Disallow use of javascript: urls
|
|
438
433
|
// https://eslint.org/docs/rules/no-script-url
|
|
439
|
-
|
|
434
|
+
'eslint/no-script-url': 'error',
|
|
440
435
|
|
|
441
436
|
// Disallow comma operators
|
|
442
437
|
// https://eslint.org/docs/rules/no-sequences
|
|
443
|
-
|
|
438
|
+
'eslint/no-sequences': 'error',
|
|
444
439
|
|
|
445
440
|
// Disallow variable declarations from shadowing variables declared in the outer scope
|
|
446
441
|
// https://eslint.org/docs/rules/no-shadow
|
|
447
|
-
|
|
442
|
+
'eslint/no-shadow': 'error',
|
|
448
443
|
|
|
449
444
|
// Disallow identifiers from shadowing restricted names
|
|
450
445
|
// https://eslint.org/docs/rules/no-shadow-restricted-names
|
|
451
|
-
|
|
446
|
+
'eslint/no-shadow-restricted-names': 'error',
|
|
452
447
|
|
|
453
448
|
// Disallow throwing literals as exceptions
|
|
454
449
|
// https://eslint.org/docs/rules/no-throw-literal
|
|
455
|
-
|
|
450
|
+
'eslint/no-throw-literal': 'error',
|
|
456
451
|
|
|
457
452
|
// Disallow ternary operators when simpler alternatives exist
|
|
458
453
|
// https://eslint.org/docs/rules/no-unneeded-ternary
|
|
459
|
-
|
|
454
|
+
'eslint/no-unneeded-ternary': ['error', { defaultAssignment: false }],
|
|
460
455
|
|
|
461
456
|
// Disallow unused expressions
|
|
462
457
|
// https://eslint.org/docs/rules/no-unused-expressions
|
|
463
|
-
|
|
458
|
+
'eslint/no-unused-expressions': 'error',
|
|
464
459
|
|
|
465
460
|
// Disallow unused labels
|
|
466
461
|
// https://eslint.org/docs/rules/no-unused-labels
|
|
467
|
-
|
|
462
|
+
'eslint/no-unused-labels': 'error',
|
|
468
463
|
|
|
469
464
|
// Disallow unnecessary catch clauses
|
|
470
465
|
// https://eslint.org/docs/rules/no-useless-catch
|
|
471
|
-
|
|
466
|
+
'eslint/no-useless-catch': 'error',
|
|
472
467
|
|
|
473
468
|
// Disallow unnecessary computed property keys in objects and classes
|
|
474
469
|
// https://eslint.org/docs/rules/no-useless-computed-key
|
|
475
|
-
|
|
470
|
+
'eslint/no-useless-computed-key': 'error',
|
|
476
471
|
|
|
477
472
|
// Disallow unnecessary concatenation of literals or template literals
|
|
478
473
|
// https://eslint.org/docs/rules/no-useless-concat
|
|
479
|
-
|
|
474
|
+
'eslint/no-useless-concat': 'error',
|
|
480
475
|
|
|
481
476
|
// Disallow unnecessary constructors
|
|
482
477
|
// https://eslint.org/docs/rules/no-useless-constructor
|
|
483
|
-
|
|
478
|
+
'eslint/no-useless-constructor': 'error',
|
|
484
479
|
|
|
485
480
|
// Disallow unnecessary escape characters
|
|
486
481
|
// https://eslint.org/docs/rules/no-useless-escape
|
|
487
|
-
|
|
482
|
+
'eslint/no-useless-escape': 'error',
|
|
488
483
|
|
|
489
484
|
// Disallow renaming import, export, and destructured assignments to the same name
|
|
490
485
|
// https://eslint.org/docs/rules/no-useless-rename
|
|
491
|
-
|
|
486
|
+
'eslint/no-useless-rename': 'error',
|
|
492
487
|
|
|
493
488
|
// Disallow redundant return statements
|
|
494
489
|
// https://eslint.org/docs/rules/no-useless-return
|
|
495
|
-
|
|
490
|
+
'eslint/no-useless-return': 'error',
|
|
496
491
|
|
|
497
492
|
// Require let or const instead of var
|
|
498
493
|
// https://eslint.org/docs/rules/no-var
|
|
499
|
-
|
|
494
|
+
'eslint/no-var': 'error',
|
|
500
495
|
|
|
501
496
|
// Disallow void operators
|
|
502
497
|
// https://eslint.org/docs/rules/no-void
|
|
503
|
-
|
|
504
|
-
// note: typescript.
|
|
498
|
+
'eslint/no-void': 'error',
|
|
499
|
+
// note: typescript.ts overrides this to ["error", { "allowAsStatement": true }]
|
|
505
500
|
|
|
506
501
|
// Disallow with statements
|
|
507
502
|
// https://eslint.org/docs/rules/no-with
|
|
508
|
-
|
|
503
|
+
'eslint/no-with': 'error',
|
|
509
504
|
|
|
510
505
|
// Require const declarations for variables that are never reassigned after declared
|
|
511
506
|
// https://eslint.org/docs/rules/prefer-const
|
|
512
|
-
|
|
507
|
+
'eslint/prefer-const': ['error', { destructuring: 'any', ignoreReadBeforeAssign: true }],
|
|
513
508
|
|
|
514
509
|
// Require destructuring from arrays and/or objects
|
|
515
510
|
// https://eslint.org/docs/rules/prefer-destructuring
|
|
516
|
-
|
|
517
|
-
|
|
511
|
+
'eslint/prefer-destructuring': [
|
|
512
|
+
'error',
|
|
518
513
|
{
|
|
519
|
-
|
|
520
|
-
|
|
514
|
+
VariableDeclarator: { array: false, object: true },
|
|
515
|
+
AssignmentExpression: { array: true, object: false },
|
|
521
516
|
},
|
|
522
|
-
{
|
|
517
|
+
{ enforceForRenamedProperties: false },
|
|
523
518
|
],
|
|
524
519
|
|
|
525
520
|
// Disallow the use of Math.pow in favor of the ** operator
|
|
526
521
|
// https://eslint.org/docs/rules/prefer-exponentiation-operator
|
|
527
|
-
|
|
522
|
+
'eslint/prefer-exponentiation-operator': 'error',
|
|
528
523
|
|
|
529
524
|
// Disallow parseInt() and Number.parseInt() in favor of binary, octal, and hexadecimal literals
|
|
530
525
|
// https://eslint.org/docs/rules/prefer-numeric-literals
|
|
531
|
-
|
|
526
|
+
'eslint/prefer-numeric-literals': 'error',
|
|
532
527
|
|
|
533
528
|
// Disallow use of Object.prototype.hasOwnProperty.call() and prefer use of Object.hasOwn()
|
|
534
529
|
// https://eslint.org/docs/rules/prefer-object-has-own
|
|
535
|
-
|
|
530
|
+
'eslint/prefer-object-has-own': 'error',
|
|
536
531
|
|
|
537
532
|
// Prefer use of an object spread over Object.assign
|
|
538
533
|
// https://eslint.org/docs/rules/prefer-object-spread
|
|
539
|
-
|
|
534
|
+
'eslint/prefer-object-spread': 'error',
|
|
540
535
|
|
|
541
536
|
// Require using Error objects as Promise rejection reasons
|
|
542
537
|
// https://eslint.org/docs/rules/prefer-promise-reject-errors
|
|
543
|
-
|
|
538
|
+
'eslint/prefer-promise-reject-errors': ['error', { allowEmptyReject: true }],
|
|
544
539
|
|
|
545
540
|
// Require rest parameters instead of arguments
|
|
546
541
|
// https://eslint.org/docs/rules/prefer-rest-params
|
|
547
|
-
|
|
542
|
+
'eslint/prefer-rest-params': 'error',
|
|
548
543
|
|
|
549
544
|
// Require spread operators instead of .apply()
|
|
550
545
|
// https://eslint.org/docs/rules/prefer-spread
|
|
551
|
-
|
|
546
|
+
'eslint/prefer-spread': 'error',
|
|
552
547
|
|
|
553
548
|
// Require template literals instead of string concatenation
|
|
554
549
|
// https://eslint.org/docs/rules/prefer-template
|
|
555
|
-
|
|
550
|
+
'eslint/prefer-template': 'error',
|
|
556
551
|
|
|
557
552
|
// Disallow losing originally caught error when re-throwing custom errors
|
|
558
553
|
// https://eslint.org/docs/rules/preserve-caught-error
|
|
559
|
-
|
|
554
|
+
'eslint/preserve-caught-error': ['error', { requireCatchParameter: false }],
|
|
560
555
|
|
|
561
556
|
// Enforce the consistent use of the radix argument when using parseInt()
|
|
562
557
|
// https://eslint.org/docs/rules/radix
|
|
563
|
-
|
|
558
|
+
'eslint/radix': 'error',
|
|
564
559
|
|
|
565
560
|
// Disallow async functions which have no await expression
|
|
566
561
|
// https://eslint.org/docs/rules/require-await
|
|
567
|
-
|
|
562
|
+
'eslint/require-await': 'error',
|
|
568
563
|
|
|
569
564
|
// Require generator functions to contain yield
|
|
570
565
|
// https://eslint.org/docs/rules/require-yield
|
|
571
|
-
|
|
566
|
+
'eslint/require-yield': 'error',
|
|
572
567
|
|
|
573
568
|
// Require symbol descriptions
|
|
574
569
|
// https://eslint.org/docs/rules/symbol-description
|
|
575
|
-
|
|
570
|
+
'eslint/symbol-description': 'error',
|
|
576
571
|
|
|
577
572
|
// Require or disallow "Yoda" conditions
|
|
578
573
|
// https://eslint.org/docs/rules/yoda
|
|
579
|
-
|
|
574
|
+
'eslint/yoda': 'error',
|
|
580
575
|
|
|
581
576
|
// -- oxc rules (oxlint-specific, no eslint equivalent) --
|
|
582
577
|
// These are bug-catchers that oxlint can detect natively.
|
|
583
578
|
|
|
584
579
|
// Disallow calling array methods on arguments (it's array-like, not an array)
|
|
585
580
|
// https://oxc.rs/docs/guide/usage/linter/rules/oxc/bad-array-method-on-arguments.html
|
|
586
|
-
|
|
581
|
+
'oxc/bad-array-method-on-arguments': 'error',
|
|
587
582
|
|
|
588
583
|
// Disallow comparing charAt() result to multi-char string (always false)
|
|
589
584
|
// https://oxc.rs/docs/guide/usage/linter/rules/oxc/bad-char-at-comparison.html
|
|
590
|
-
|
|
585
|
+
'oxc/bad-char-at-comparison': 'error',
|
|
591
586
|
|
|
592
587
|
// Disallow chained comparisons like a < b < c (evaluates left to boolean first)
|
|
593
588
|
// https://oxc.rs/docs/guide/usage/linter/rules/oxc/bad-comparison-sequence.html
|
|
594
|
-
|
|
589
|
+
'oxc/bad-comparison-sequence': 'error',
|
|
595
590
|
|
|
596
591
|
// Disallow swapped/nested min/max that produce constant results
|
|
597
592
|
// https://oxc.rs/docs/guide/usage/linter/rules/oxc/bad-min-max-func.html
|
|
598
|
-
|
|
593
|
+
'oxc/bad-min-max-func': 'error',
|
|
599
594
|
|
|
600
595
|
// Disallow reference-equality checks against object/array literals (always false)
|
|
601
596
|
// https://oxc.rs/docs/guide/usage/linter/rules/oxc/bad-object-literal-comparison.html
|
|
602
|
-
|
|
597
|
+
'oxc/bad-object-literal-comparison': 'error',
|
|
603
598
|
|
|
604
599
|
// Disallow replaceAll with regex missing the global flag (throws at runtime)
|
|
605
600
|
// https://oxc.rs/docs/guide/usage/linter/rules/oxc/bad-replace-all-arg.html
|
|
606
|
-
|
|
601
|
+
'oxc/bad-replace-all-arg': 'error',
|
|
607
602
|
|
|
608
603
|
// Disallow redundant or impossible comparisons (x >= 5 && x >= 3)
|
|
609
604
|
// https://oxc.rs/docs/guide/usage/linter/rules/oxc/const-comparisons.html
|
|
610
|
-
|
|
605
|
+
'oxc/const-comparisons': 'error',
|
|
611
606
|
|
|
612
607
|
// Disallow comparisons that can be simplified (a === b || a < b → a <= b)
|
|
613
608
|
// https://oxc.rs/docs/guide/usage/linter/rules/oxc/double-comparisons.html
|
|
614
|
-
|
|
609
|
+
'oxc/double-comparisons': 'error',
|
|
615
610
|
|
|
616
611
|
// Disallow operations that always produce the same value (x * 0, x & 0)
|
|
617
612
|
// https://oxc.rs/docs/guide/usage/linter/rules/oxc/erasing-op.html
|
|
618
|
-
|
|
613
|
+
'oxc/erasing-op': 'error',
|
|
619
614
|
|
|
620
615
|
// Disallow constructing Error without throw
|
|
621
616
|
// https://oxc.rs/docs/guide/usage/linter/rules/oxc/missing-throw.html
|
|
622
|
-
|
|
617
|
+
'oxc/missing-throw': 'error',
|
|
623
618
|
|
|
624
619
|
// Disallow numeric arguments outside valid range (parseInt radix, toFixed digits)
|
|
625
620
|
// https://oxc.rs/docs/guide/usage/linter/rules/oxc/number-arg-out-of-range.html
|
|
626
|
-
|
|
621
|
+
'oxc/number-arg-out-of-range': 'error',
|
|
627
622
|
|
|
628
623
|
// Disallow function params only used in recursive self-calls (likely a bug)
|
|
629
624
|
// https://oxc.rs/docs/guide/usage/linter/rules/oxc/only-used-in-recursion.html
|
|
630
|
-
|
|
625
|
+
'oxc/only-used-in-recursion': 'error',
|
|
631
626
|
|
|
632
627
|
// Disallow passing functions to array methods when signatures don't match
|
|
633
628
|
// https://oxc.rs/docs/guide/usage/linter/rules/oxc/uninvoked-array-callback.html
|
|
634
|
-
|
|
629
|
+
'oxc/uninvoked-array-callback': 'error',
|
|
635
630
|
},
|
|
636
|
-
}
|
|
631
|
+
};
|