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