@wistia/oxlint-config 0.7.4 → 0.8.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 +15 -1
- package/package.json +12 -11
- package/rules/barrel-files.mjs +3 -0
- package/rules/base.mjs +67 -6
- package/rules/import.mjs +63 -46
- package/rules/node.mjs +15 -13
- package/rules/promise.mjs +2 -0
- package/rules/react-a11y.mjs +53 -5
- package/rules/react.mjs +75 -65
- package/rules/typescript.mjs +13 -2
- package/rules/vitest.mjs +89 -82
package/rules/react.mjs
CHANGED
|
@@ -14,7 +14,7 @@ export const reactRules = {
|
|
|
14
14
|
|
|
15
15
|
// Enforce curly braces or disallow unnecessary curly braces in JSX props and children
|
|
16
16
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/jsx-curly-brace-presence.html
|
|
17
|
-
//
|
|
17
|
+
// Decision: stylistic choice best left for formatter
|
|
18
18
|
'react/jsx-curly-brace-presence': 'off',
|
|
19
19
|
|
|
20
20
|
// Enforce shorthand or standard form for React fragments
|
|
@@ -27,7 +27,7 @@ export const reactRules = {
|
|
|
27
27
|
|
|
28
28
|
// Enforce a maximum depth that JSX can be nested
|
|
29
29
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/jsx-max-depth.html
|
|
30
|
-
//
|
|
30
|
+
// Decision: not useful enough to justify the performance cost
|
|
31
31
|
'react/jsx-max-depth': 'off',
|
|
32
32
|
|
|
33
33
|
// Disallow comments from being inserted as text nodes
|
|
@@ -40,8 +40,7 @@ export const reactRules = {
|
|
|
40
40
|
|
|
41
41
|
// Disallow duplicate properties in JSX
|
|
42
42
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/jsx-no-duplicate-props.html
|
|
43
|
-
|
|
44
|
-
'react/jsx-no-duplicate-props': 'off',
|
|
43
|
+
'react/jsx-no-duplicate-props': 'error',
|
|
45
44
|
|
|
46
45
|
// Disallow javascript: URLs
|
|
47
46
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/jsx-no-script-url.html
|
|
@@ -53,28 +52,24 @@ export const reactRules = {
|
|
|
53
52
|
|
|
54
53
|
// Disallow undeclared variables in JSX
|
|
55
54
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/jsx-no-undef.html
|
|
56
|
-
//
|
|
55
|
+
// Decision: this rule is generally unnecessary if using TypeScript
|
|
57
56
|
'react/jsx-no-undef': 'off',
|
|
58
57
|
|
|
59
58
|
// Disallow unnecessary fragments
|
|
60
59
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/jsx-no-useless-fragment.html
|
|
61
|
-
|
|
62
|
-
// and produces false positives on valid patterns
|
|
63
|
-
'react/jsx-no-useless-fragment': 'off',
|
|
60
|
+
'react/jsx-no-useless-fragment': ['error', { allowExpressions: true }],
|
|
64
61
|
|
|
65
62
|
// Enforce PascalCase for user-defined JSX components
|
|
66
63
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/jsx-pascal-case.html
|
|
67
|
-
|
|
68
|
-
'react/jsx-pascal-case': 'off',
|
|
64
|
+
'react/jsx-pascal-case': ['error', { allowNamespace: true }],
|
|
69
65
|
|
|
70
66
|
// Disallow spreading props on multiple JSX elements (and merging objects)
|
|
71
67
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/jsx-props-no-spread-multi.html
|
|
72
|
-
|
|
73
|
-
'react/jsx-props-no-spread-multi': 'off',
|
|
68
|
+
'react/jsx-props-no-spread-multi': 'error',
|
|
74
69
|
|
|
75
70
|
// Disallow JSX prop spreading
|
|
76
71
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/jsx-props-no-spreading.html
|
|
77
|
-
//
|
|
72
|
+
// Decision: this is a decision best left to the implementer
|
|
78
73
|
'react/jsx-props-no-spreading': 'off',
|
|
79
74
|
|
|
80
75
|
// Disallow Array.prototype.map() key from being an array index
|
|
@@ -103,37 +98,42 @@ export const reactRules = {
|
|
|
103
98
|
|
|
104
99
|
// Disallow usage of isMounted
|
|
105
100
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/no-is-mounted.html
|
|
106
|
-
|
|
107
|
-
'react/no-is-mounted': 'off',
|
|
101
|
+
'react/no-is-mounted': 'error',
|
|
108
102
|
|
|
109
103
|
// Disallow defining multiple components in a single file (allow colocated stateless helpers)
|
|
110
104
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/no-multi-comp.html
|
|
111
|
-
//
|
|
105
|
+
// Decision: this is a decision best left to the implementer
|
|
112
106
|
'react/no-multi-comp': 'off',
|
|
113
107
|
|
|
108
|
+
// Disallow object types as default props
|
|
109
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/react/no-object-type-as-default-prop.html
|
|
110
|
+
'react/no-object-type-as-default-prop': 'error',
|
|
111
|
+
|
|
112
|
+
// Disallow creating unstable components inside components
|
|
113
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/react/no-unstable-nested-components.html
|
|
114
|
+
'react/no-unstable-nested-components': 'error',
|
|
115
|
+
|
|
114
116
|
// Disallow usage of the return value of ReactDOM.render
|
|
115
117
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/no-render-return-value.html
|
|
116
118
|
'react/no-render-return-value': 'error',
|
|
117
119
|
|
|
118
120
|
// Disallow usage of setState
|
|
119
121
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/no-set-state.html
|
|
120
|
-
//
|
|
122
|
+
// Decision: this is too broad, should be enabled at a project level if desired
|
|
121
123
|
'react/no-set-state': 'off',
|
|
122
124
|
|
|
123
125
|
// Disallow using string references
|
|
124
126
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/no-string-refs.html
|
|
125
|
-
|
|
126
|
-
'react/no-string-refs': 'off',
|
|
127
|
+
'react/no-string-refs': 'error',
|
|
127
128
|
|
|
128
129
|
// Disallow this from being used in stateless functional components
|
|
129
130
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/no-this-in-sfc.html
|
|
130
|
-
//
|
|
131
|
+
// Decision: stylistic choice best left for formatter
|
|
131
132
|
'react/no-this-in-sfc': 'off',
|
|
132
133
|
|
|
133
134
|
// Disallow unescaped HTML entities from appearing in markup
|
|
134
135
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/no-unescaped-entities.html
|
|
135
|
-
|
|
136
|
-
'react/no-unescaped-entities': 'off',
|
|
136
|
+
'react/no-unescaped-entities': 'error',
|
|
137
137
|
|
|
138
138
|
// Disallow usage of unknown DOM property
|
|
139
139
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/no-unknown-property.html
|
|
@@ -141,8 +141,7 @@ export const reactRules = {
|
|
|
141
141
|
|
|
142
142
|
// Disallow usage of unsafe lifecycle methods
|
|
143
143
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/no-unsafe.html
|
|
144
|
-
|
|
145
|
-
'react/no-unsafe': 'off',
|
|
144
|
+
'react/no-unsafe': 'error',
|
|
146
145
|
|
|
147
146
|
// Disallow usage of deprecated methods
|
|
148
147
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/no-redundant-should-component-update.html
|
|
@@ -162,7 +161,7 @@ export const reactRules = {
|
|
|
162
161
|
|
|
163
162
|
// Disallow usage of React.Children APIs
|
|
164
163
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/no-react-children.html
|
|
165
|
-
//
|
|
164
|
+
// Decision: stylistic choice best left for formatter
|
|
166
165
|
'react/no-react-children': 'off',
|
|
167
166
|
|
|
168
167
|
// Disallow usage of cloneElement
|
|
@@ -171,22 +170,22 @@ export const reactRules = {
|
|
|
171
170
|
|
|
172
171
|
// Enforce ES5 or ES6 class for React Components
|
|
173
172
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/prefer-es6-class.html
|
|
174
|
-
//
|
|
173
|
+
// Decision: stylistic choice best left for formatter
|
|
175
174
|
'react/prefer-es6-class': 'off',
|
|
176
175
|
|
|
177
176
|
// Enforce that components that only export from react can only export components
|
|
178
177
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/only-export-components.html
|
|
179
|
-
//
|
|
178
|
+
// Decision: stylistic choice best left for formatter
|
|
180
179
|
'react/only-export-components': 'off',
|
|
181
180
|
|
|
182
181
|
// Prevent missing displayName in a React component definition
|
|
183
182
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/display-name.html
|
|
184
|
-
//
|
|
183
|
+
// Decision: stylistic choice best left for formatter (equivalent @eslint-react/no-missing-component-display-name is "off")
|
|
185
184
|
'react/display-name': 'off',
|
|
186
185
|
|
|
187
186
|
// Enforce a specific function type for function components
|
|
188
187
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/forward-ref-uses-ref.html
|
|
189
|
-
//
|
|
188
|
+
// Decision: stylistic choice best left for formatter
|
|
190
189
|
'react/forward-ref-uses-ref': 'off',
|
|
191
190
|
|
|
192
191
|
// Enforce sandbox attribute on iframe elements
|
|
@@ -195,7 +194,7 @@ export const reactRules = {
|
|
|
195
194
|
|
|
196
195
|
// Enforce checked/onChange or readonly for checkboxes
|
|
197
196
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/checked-requires-onchange-or-readonly.html
|
|
198
|
-
//
|
|
197
|
+
// Decision: stylistic choice best left for formatter
|
|
199
198
|
'react/checked-requires-onchange-or-readonly': 'off',
|
|
200
199
|
|
|
201
200
|
// Disallow void DOM elements from receiving children
|
|
@@ -204,7 +203,7 @@ export const reactRules = {
|
|
|
204
203
|
|
|
205
204
|
// Enforce component methods order
|
|
206
205
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/require-render-return.html
|
|
207
|
-
//
|
|
206
|
+
// Decision: stylistic choice best left for formatter
|
|
208
207
|
'react/require-render-return': 'off',
|
|
209
208
|
|
|
210
209
|
// Enforce Rules of Hooks
|
|
@@ -217,13 +216,12 @@ export const reactRules = {
|
|
|
217
216
|
|
|
218
217
|
// Enforce JSX filename extension (allow .jsx and .tsx)
|
|
219
218
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/jsx-filename-extension.html
|
|
220
|
-
//
|
|
219
|
+
// Decision: stylistic choice best left for formatter
|
|
221
220
|
'react/jsx-filename-extension': 'off',
|
|
222
221
|
|
|
223
222
|
// Enforce self-closing tags for components without children
|
|
224
223
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/self-closing-comp.html
|
|
225
|
-
|
|
226
|
-
'react/self-closing-comp': 'off',
|
|
224
|
+
'react/self-closing-comp': 'error',
|
|
227
225
|
|
|
228
226
|
// Enforce style prop value is an object
|
|
229
227
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/style-prop-object.html
|
|
@@ -231,39 +229,47 @@ export const reactRules = {
|
|
|
231
229
|
|
|
232
230
|
// Enforce event handler naming conventions in JSX
|
|
233
231
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/jsx-handler-names.html
|
|
234
|
-
//
|
|
232
|
+
// Decision: stylistic choice best left for formatter
|
|
235
233
|
'react/jsx-handler-names': 'off',
|
|
236
234
|
|
|
237
235
|
// Forbid certain props on components
|
|
238
236
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/forbid-component-props.html
|
|
237
|
+
// Decision: requires project-specific configuration
|
|
239
238
|
'react/forbid-component-props': 'off',
|
|
240
239
|
|
|
241
240
|
// Forbid certain props on DOM elements
|
|
242
241
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/forbid-dom-props.html
|
|
242
|
+
// Decision: requires project-specific configuration
|
|
243
243
|
'react/forbid-dom-props': 'off',
|
|
244
244
|
|
|
245
245
|
// Forbid certain elements
|
|
246
246
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/forbid-elements.html
|
|
247
|
+
// Decision: requires project-specific configuration
|
|
247
248
|
'react/forbid-elements': 'off',
|
|
248
249
|
|
|
249
250
|
// Enforce destructuring assignment of useState hook
|
|
250
251
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/hook-use-state.html
|
|
252
|
+
// Decision: too opinionated for general use
|
|
251
253
|
'react/hook-use-state': 'off',
|
|
252
254
|
|
|
253
255
|
// Disallow usage of setState in componentDidUpdate (deprecated lifecycle)
|
|
254
256
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/no-did-update-set-state.html
|
|
257
|
+
// Decision: deprecated lifecycle method
|
|
255
258
|
'react/no-did-update-set-state': 'off',
|
|
256
259
|
|
|
257
260
|
// Prefer function components over class components
|
|
258
261
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/prefer-function-component.html
|
|
262
|
+
// Decision: too opinionated for general use
|
|
259
263
|
'react/prefer-function-component': 'off',
|
|
260
264
|
|
|
261
265
|
// Disallow missing React when using JSX (not needed with modern React)
|
|
262
266
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/react-in-jsx-scope.html
|
|
267
|
+
// Decision: not needed with modern React JSX transform
|
|
263
268
|
'react/react-in-jsx-scope': 'off',
|
|
264
269
|
|
|
265
270
|
// Enforce state initialization in constructor
|
|
266
271
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/state-in-constructor.html
|
|
272
|
+
// Decision: too opinionated for general use
|
|
267
273
|
'react/state-in-constructor': 'off',
|
|
268
274
|
|
|
269
275
|
//rules via jsPlugins (@eslint-react/eslint-plugin)
|
|
@@ -278,7 +284,7 @@ export const reactRules = {
|
|
|
278
284
|
|
|
279
285
|
// Verify the list of the dependencies for Hooks like useEffect and similar
|
|
280
286
|
// https://eslint-react.xyz/docs/rules/exhaustive-deps
|
|
281
|
-
//
|
|
287
|
+
// Decision: handled by native react/exhaustive-deps
|
|
282
288
|
'@eslint-react/exhaustive-deps': 'off',
|
|
283
289
|
|
|
284
290
|
// Validates against mutating props, state, and other immutable values
|
|
@@ -287,7 +293,7 @@ export const reactRules = {
|
|
|
287
293
|
|
|
288
294
|
// Prevent accidental JS comments from being injected into JSX as text
|
|
289
295
|
// https://eslint-react.xyz/docs/rules/jsx-no-comment-textnodes
|
|
290
|
-
//
|
|
296
|
+
// Decision: handled by native react/jsx-no-comment-textnodes
|
|
291
297
|
'@eslint-react/jsx-no-comment-textnodes': 'off',
|
|
292
298
|
|
|
293
299
|
// Prevents unintentional '$' sign before expression in JSX
|
|
@@ -300,7 +306,7 @@ export const reactRules = {
|
|
|
300
306
|
|
|
301
307
|
// Prevent passing of children as props
|
|
302
308
|
// https://eslint-react.xyz/docs/rules/jsx-no-children-prop
|
|
303
|
-
//
|
|
309
|
+
// Decision: handled by native react/no-children-prop
|
|
304
310
|
'@eslint-react/jsx-no-children-prop': 'off',
|
|
305
311
|
|
|
306
312
|
// Prevent children prop used alongside children in JSX
|
|
@@ -317,7 +323,7 @@ export const reactRules = {
|
|
|
317
323
|
|
|
318
324
|
// Disallow namespace in JSX
|
|
319
325
|
// https://eslint-react.xyz/docs/rules/jsx-no-namespace
|
|
320
|
-
//
|
|
326
|
+
// Decision: handled by native react/no-namespace
|
|
321
327
|
'@eslint-react/jsx-no-namespace': 'off',
|
|
322
328
|
|
|
323
329
|
// Prevent using this.state within a this.setState
|
|
@@ -326,7 +332,7 @@ export const reactRules = {
|
|
|
326
332
|
|
|
327
333
|
// Prevent usage of Array index in keys
|
|
328
334
|
// https://eslint-react.xyz/docs/rules/no-array-index-key
|
|
329
|
-
//
|
|
335
|
+
// Decision: handled by native react/no-array-index-key
|
|
330
336
|
'@eslint-react/no-array-index-key': 'off',
|
|
331
337
|
|
|
332
338
|
// Disallow usage of Children.count
|
|
@@ -355,7 +361,7 @@ export const reactRules = {
|
|
|
355
361
|
|
|
356
362
|
// Disallow usage of cloneElement
|
|
357
363
|
// https://eslint-react.xyz/docs/rules/no-clone-element
|
|
358
|
-
//
|
|
364
|
+
// Decision: handled by native react/no-clone-element
|
|
359
365
|
'@eslint-react/no-clone-element': 'off',
|
|
360
366
|
|
|
361
367
|
// Disallow usage of componentWillMount
|
|
@@ -380,7 +386,7 @@ export const reactRules = {
|
|
|
380
386
|
|
|
381
387
|
// Prevent direct mutation of this.state
|
|
382
388
|
// https://eslint-react.xyz/docs/rules/no-direct-mutation-state
|
|
383
|
-
//
|
|
389
|
+
// Decision: handled by native react/no-direct-mutation-state
|
|
384
390
|
'@eslint-react/no-direct-mutation-state': 'off',
|
|
385
391
|
|
|
386
392
|
// Disallow duplicate keys in JSX arrays
|
|
@@ -393,35 +399,37 @@ export const reactRules = {
|
|
|
393
399
|
|
|
394
400
|
// Prevent implicitly passing the children prop
|
|
395
401
|
// https://eslint-react.xyz/docs/rules/no-implicit-children
|
|
396
|
-
//
|
|
402
|
+
// Decision: requires TypeScript type-checker services unavailable in oxlint jsPlugin runtime
|
|
397
403
|
'@eslint-react/no-implicit-children': 'off',
|
|
398
404
|
|
|
399
405
|
// Prevent implicitly passing the key prop
|
|
400
406
|
// https://eslint-react.xyz/docs/rules/no-implicit-key
|
|
401
|
-
//
|
|
407
|
+
// Decision: requires TypeScript type-checker services unavailable in oxlint jsPlugin runtime
|
|
402
408
|
'@eslint-react/no-implicit-key': 'off',
|
|
403
409
|
|
|
404
410
|
// Prevent implicitly passing the ref prop
|
|
405
411
|
// https://eslint-react.xyz/docs/rules/no-implicit-ref
|
|
406
|
-
//
|
|
412
|
+
// Decision: requires TypeScript type-checker services unavailable in oxlint jsPlugin runtime
|
|
407
413
|
'@eslint-react/no-implicit-ref': 'off',
|
|
408
414
|
|
|
409
415
|
// Prevent problematic leaked values from being rendered
|
|
410
416
|
// https://eslint-react.xyz/docs/rules/no-leaked-conditional-rendering
|
|
411
|
-
//
|
|
417
|
+
// Decision: requires TypeScript type-checker services unavailable in oxlint jsPlugin runtime
|
|
412
418
|
'@eslint-react/no-leaked-conditional-rendering': 'off',
|
|
413
419
|
|
|
414
420
|
// Enforce that components have a displayName for DevTools
|
|
415
421
|
// https://eslint-react.xyz/docs/rules/no-missing-component-display-name
|
|
422
|
+
// Decision: too opinionated for general use
|
|
416
423
|
'@eslint-react/no-missing-component-display-name': 'off',
|
|
417
424
|
|
|
418
425
|
// Enforce that contexts have a displayName for DevTools
|
|
419
426
|
// https://eslint-react.xyz/docs/rules/no-missing-context-display-name
|
|
427
|
+
// Decision: too opinionated for general use
|
|
420
428
|
'@eslint-react/no-missing-context-display-name': 'off',
|
|
421
429
|
|
|
422
430
|
// Enforce that every JSX element in a list has a key prop
|
|
423
431
|
// https://eslint-react.xyz/docs/rules/no-missing-key
|
|
424
|
-
//
|
|
432
|
+
// Decision: handled by native react/jsx-key
|
|
425
433
|
'@eslint-react/no-missing-key': 'off',
|
|
426
434
|
|
|
427
435
|
// Disallow misusing captureOwnerStack
|
|
@@ -430,7 +438,8 @@ export const reactRules = {
|
|
|
430
438
|
|
|
431
439
|
// Prevent creating unstable components inside components
|
|
432
440
|
// https://eslint-react.xyz/docs/rules/no-nested-component-definitions
|
|
433
|
-
|
|
441
|
+
// Decision: handled by native react/no-unstable-nested-components
|
|
442
|
+
'@eslint-react/no-nested-component-definitions': 'off',
|
|
434
443
|
|
|
435
444
|
// Prevent creating lazy components inside components
|
|
436
445
|
// https://eslint-react.xyz/docs/rules/no-nested-lazy-component-declarations
|
|
@@ -438,7 +447,7 @@ export const reactRules = {
|
|
|
438
447
|
|
|
439
448
|
// Prevent usage of setState in componentDidMount
|
|
440
449
|
// https://eslint-react.xyz/docs/rules/no-set-state-in-component-did-mount
|
|
441
|
-
//
|
|
450
|
+
// Decision: handled by native react/no-did-mount-set-state
|
|
442
451
|
'@eslint-react/no-set-state-in-component-did-mount': 'off',
|
|
443
452
|
|
|
444
453
|
// Prevent usage of setState in componentDidUpdate
|
|
@@ -447,7 +456,7 @@ export const reactRules = {
|
|
|
447
456
|
|
|
448
457
|
// Prevent usage of setState in componentWillUpdate
|
|
449
458
|
// https://eslint-react.xyz/docs/rules/no-set-state-in-component-will-update
|
|
450
|
-
//
|
|
459
|
+
// Decision: handled by native react/no-will-update-set-state
|
|
451
460
|
'@eslint-react/no-set-state-in-component-will-update': 'off',
|
|
452
461
|
|
|
453
462
|
// Disallow unnecessary "use" prefix on custom hooks
|
|
@@ -468,12 +477,13 @@ export const reactRules = {
|
|
|
468
477
|
|
|
469
478
|
// Prevent non-stable values used as context values
|
|
470
479
|
// https://eslint-react.xyz/docs/rules/no-unstable-context-value
|
|
471
|
-
//
|
|
480
|
+
// Decision: handled by native react/jsx-no-constructed-context-values
|
|
472
481
|
'@eslint-react/no-unstable-context-value': 'off',
|
|
473
482
|
|
|
474
483
|
// Disallow referential-type variables as default props
|
|
475
484
|
// https://eslint-react.xyz/docs/rules/no-unstable-default-props
|
|
476
|
-
|
|
485
|
+
// Decision: handled by native react/no-object-type-as-default-prop
|
|
486
|
+
'@eslint-react/no-unstable-default-props': 'off',
|
|
477
487
|
|
|
478
488
|
// Prevent declaring unused methods of component class
|
|
479
489
|
// https://eslint-react.xyz/docs/rules/no-unused-class-component-members
|
|
@@ -481,7 +491,7 @@ export const reactRules = {
|
|
|
481
491
|
|
|
482
492
|
// Warn about component props that are defined but never used
|
|
483
493
|
// https://eslint-react.xyz/docs/rules/no-unused-props
|
|
484
|
-
//
|
|
494
|
+
// Decision: requires TypeScript type-checker services unavailable in oxlint jsPlugin runtime
|
|
485
495
|
'@eslint-react/no-unused-props': 'off',
|
|
486
496
|
|
|
487
497
|
// Prevent unused state values
|
|
@@ -502,7 +512,7 @@ export const reactRules = {
|
|
|
502
512
|
|
|
503
513
|
// Enforce Rules of Hooks
|
|
504
514
|
// https://eslint-react.xyz/docs/rules/rules-of-hooks
|
|
505
|
-
//
|
|
515
|
+
// Decision: handled by native react/rules-of-hooks
|
|
506
516
|
'@eslint-react/rules-of-hooks': 'off',
|
|
507
517
|
|
|
508
518
|
// Validates against calling setState synchronously in an effect
|
|
@@ -533,17 +543,17 @@ export const reactRules = {
|
|
|
533
543
|
|
|
534
544
|
// Warn on usage of dangerouslySetInnerHTML
|
|
535
545
|
// https://eslint-react.xyz/docs/rules/dom-no-dangerously-set-innerhtml
|
|
536
|
-
//
|
|
546
|
+
// Decision: handled by native react/no-danger
|
|
537
547
|
'@eslint-react/dom-no-dangerously-set-innerhtml': 'off',
|
|
538
548
|
|
|
539
549
|
// Prevent problem with children and dangerouslySetInnerHTML
|
|
540
550
|
// https://eslint-react.xyz/docs/rules/dom-no-dangerously-set-innerhtml-with-children
|
|
541
|
-
//
|
|
551
|
+
// Decision: handled by native react/no-danger-with-children
|
|
542
552
|
'@eslint-react/dom-no-dangerously-set-innerhtml-with-children': 'off',
|
|
543
553
|
|
|
544
554
|
// Warn against using findDOMNode()
|
|
545
555
|
// https://eslint-react.xyz/docs/rules/dom-no-find-dom-node
|
|
546
|
-
//
|
|
556
|
+
// Decision: handled by native react/no-find-dom-node
|
|
547
557
|
'@eslint-react/dom-no-find-dom-node': 'off',
|
|
548
558
|
|
|
549
559
|
// Disallow usage of flushSync
|
|
@@ -556,12 +566,12 @@ export const reactRules = {
|
|
|
556
566
|
|
|
557
567
|
// Enforce that buttons have an explicit type attribute
|
|
558
568
|
// https://eslint-react.xyz/docs/rules/dom-no-missing-button-type
|
|
559
|
-
//
|
|
569
|
+
// Decision: handled by native react/button-has-type
|
|
560
570
|
'@eslint-react/dom-no-missing-button-type': 'off',
|
|
561
571
|
|
|
562
572
|
// Enforce sandbox attribute on iframe elements
|
|
563
573
|
// https://eslint-react.xyz/docs/rules/dom-no-missing-iframe-sandbox
|
|
564
|
-
//
|
|
574
|
+
// Decision: handled by native react/iframe-missing-sandbox
|
|
565
575
|
'@eslint-react/dom-no-missing-iframe-sandbox': 'off',
|
|
566
576
|
|
|
567
577
|
// Disallow usage of ReactDOM.render (use createRoot instead)
|
|
@@ -570,22 +580,22 @@ export const reactRules = {
|
|
|
570
580
|
|
|
571
581
|
// Disallow using ReactDOM.render return value
|
|
572
582
|
// https://eslint-react.xyz/docs/rules/dom-no-render-return-value
|
|
573
|
-
//
|
|
583
|
+
// Decision: handled by native react/no-render-return-value
|
|
574
584
|
'@eslint-react/dom-no-render-return-value': 'off',
|
|
575
585
|
|
|
576
586
|
// Prevent usage of javascript: URLs
|
|
577
587
|
// https://eslint-react.xyz/docs/rules/dom-no-script-url
|
|
578
|
-
//
|
|
588
|
+
// Decision: handled by native react/jsx-no-script-url
|
|
579
589
|
'@eslint-react/dom-no-script-url': 'off',
|
|
580
590
|
|
|
581
591
|
// Require style prop value be an object
|
|
582
592
|
// https://eslint-react.xyz/docs/rules/dom-no-string-style-prop
|
|
583
|
-
//
|
|
593
|
+
// Decision: handled by native react/style-prop-object
|
|
584
594
|
'@eslint-react/dom-no-string-style-prop': 'off',
|
|
585
595
|
|
|
586
596
|
// Prevent usage of unknown DOM property
|
|
587
597
|
// https://eslint-react.xyz/docs/rules/dom-no-unknown-property
|
|
588
|
-
//
|
|
598
|
+
// Decision: handled by native react/no-unknown-property
|
|
589
599
|
'@eslint-react/dom-no-unknown-property': 'off',
|
|
590
600
|
|
|
591
601
|
// Enforce safe iframe sandbox attribute values
|
|
@@ -594,7 +604,7 @@ export const reactRules = {
|
|
|
594
604
|
|
|
595
605
|
// Disallow target="_blank" without rel="noreferrer"
|
|
596
606
|
// https://eslint-react.xyz/docs/rules/dom-no-unsafe-target-blank
|
|
597
|
-
//
|
|
607
|
+
// Decision: handled by native react/jsx-no-target-blank
|
|
598
608
|
'@eslint-react/dom-no-unsafe-target-blank': 'off',
|
|
599
609
|
|
|
600
610
|
// Disallow usage of deprecated useFormState (use useActionState instead)
|
|
@@ -603,7 +613,7 @@ export const reactRules = {
|
|
|
603
613
|
|
|
604
614
|
// Prevent void DOM elements from receiving children
|
|
605
615
|
// https://eslint-react.xyz/docs/rules/dom-no-void-elements-with-children
|
|
606
|
-
//
|
|
616
|
+
// Decision: handled by native react/void-dom-elements-no-children
|
|
607
617
|
'@eslint-react/dom-no-void-elements-with-children': 'off',
|
|
608
618
|
|
|
609
619
|
// --- RSC rules ---
|
package/rules/typescript.mjs
CHANGED
|
@@ -16,16 +16,19 @@ export const typescriptRules = {
|
|
|
16
16
|
],
|
|
17
17
|
|
|
18
18
|
// This is redundant with TypeScript's noUnusedLocals/noUnusedParameters compiler options
|
|
19
|
+
// Decision: handled by TypeScript noUnusedLocals/noUnusedParameters
|
|
19
20
|
'eslint/no-unused-vars': 'off',
|
|
20
21
|
|
|
21
22
|
// Recommended to be disabled for TypeScript projects
|
|
22
23
|
// https://github.com/typescript-eslint/typescript-eslint/blob/main/docs/linting/TROUBLESHOOTING.md#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors
|
|
24
|
+
// Decision: handled by TypeScript
|
|
23
25
|
'eslint/no-undef': 'off',
|
|
24
26
|
|
|
25
27
|
// Override base no-void to allow void as a statement (common in TS for fire-and-forget promises)
|
|
26
28
|
'eslint/no-void': ['error', { allowAsStatement: true }],
|
|
27
29
|
|
|
28
30
|
// Superseded by `typescript/require-await` below
|
|
31
|
+
// Decision: handled by typescript/require-await
|
|
29
32
|
'eslint/require-await': 'off',
|
|
30
33
|
|
|
31
34
|
// Require that function overload signatures be consecutive
|
|
@@ -70,7 +73,7 @@ export const typescriptRules = {
|
|
|
70
73
|
|
|
71
74
|
// Enforce type definitions to consistently use either interface or type
|
|
72
75
|
// https://oxc.rs/docs/guide/usage/linter/rules/typescript/consistent-type-definitions.html
|
|
73
|
-
//
|
|
76
|
+
// Decision: prefer type to interface for consistency
|
|
74
77
|
'typescript/consistent-type-definitions': ['error', 'type'],
|
|
75
78
|
|
|
76
79
|
// Enforce consistent usage of type exports
|
|
@@ -314,7 +317,7 @@ export const typescriptRules = {
|
|
|
314
317
|
|
|
315
318
|
// Enforce non-null assertions over explicit type casts
|
|
316
319
|
// https://oxc.rs/docs/guide/usage/linter/rules/typescript/non-nullable-type-assertion-style.html
|
|
317
|
-
//
|
|
320
|
+
// Decision: disabled because it conflicts with `no-non-null-assertion` — this rule's autofix
|
|
318
321
|
// rewrites `value as T` to `value!`, which `no-non-null-assertion` then rejects
|
|
319
322
|
'typescript/non-nullable-type-assertion-style': 'off',
|
|
320
323
|
|
|
@@ -444,34 +447,42 @@ export const typescriptRules = {
|
|
|
444
447
|
|
|
445
448
|
// Disallow certain types (deprecated rule)
|
|
446
449
|
// https://oxc.rs/docs/guide/usage/linter/rules/typescript/ban-types.html
|
|
450
|
+
// Decision: deprecated rule
|
|
447
451
|
'typescript/ban-types': 'off',
|
|
448
452
|
|
|
449
453
|
// Require explicit return types on functions and class methods
|
|
450
454
|
// https://oxc.rs/docs/guide/usage/linter/rules/typescript/explicit-function-return-type.html
|
|
455
|
+
// Decision: too opinionated for general use
|
|
451
456
|
'typescript/explicit-function-return-type': 'off',
|
|
452
457
|
|
|
453
458
|
// Require explicit accessibility modifiers on class properties and methods
|
|
454
459
|
// https://oxc.rs/docs/guide/usage/linter/rules/typescript/explicit-member-accessibility.html
|
|
460
|
+
// Decision: too opinionated for general use
|
|
455
461
|
'typescript/explicit-member-accessibility': 'off',
|
|
456
462
|
|
|
457
463
|
// Disallow empty interfaces (deprecated rule)
|
|
458
464
|
// https://oxc.rs/docs/guide/usage/linter/rules/typescript/no-empty-interface.html
|
|
465
|
+
// Decision: deprecated rule
|
|
459
466
|
'typescript/no-empty-interface': 'off',
|
|
460
467
|
|
|
461
468
|
// Disallow require statements except in import statements (deprecated rule)
|
|
462
469
|
// https://oxc.rs/docs/guide/usage/linter/rules/typescript/no-var-requires.html
|
|
470
|
+
// Decision: deprecated rule
|
|
463
471
|
'typescript/no-var-requires': 'off',
|
|
464
472
|
|
|
465
473
|
// Require function parameters to be typed as readonly
|
|
466
474
|
// https://oxc.rs/docs/guide/usage/linter/rules/typescript/prefer-readonly-parameter-types.html
|
|
475
|
+
// Decision: too opinionated for general use
|
|
467
476
|
'typescript/prefer-readonly-parameter-types': 'off',
|
|
468
477
|
|
|
469
478
|
// Enforce using @ts-expect-error over @ts-ignore (deprecated rule)
|
|
470
479
|
// https://oxc.rs/docs/guide/usage/linter/rules/typescript/prefer-ts-expect-error.html
|
|
480
|
+
// Decision: deprecated rule
|
|
471
481
|
'typescript/prefer-ts-expect-error': 'off',
|
|
472
482
|
|
|
473
483
|
// Enforce void return type for functions that don't return a value
|
|
474
484
|
// https://oxc.rs/docs/guide/usage/linter/rules/typescript/strict-void-return.html
|
|
485
|
+
// Decision: too opinionated for general use
|
|
475
486
|
'typescript/strict-void-return': 'off',
|
|
476
487
|
},
|
|
477
488
|
};
|