@wistia/oxlint-config 0.7.4 → 0.7.5
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/package.json +2 -1
- package/rules/barrel-files.mjs +3 -0
- package/rules/base.mjs +43 -6
- package/rules/import.mjs +54 -40
- package/rules/node.mjs +15 -13
- package/rules/promise.mjs +2 -0
- package/rules/react-a11y.mjs +2 -5
- package/rules/react.mjs +63 -63
- package/rules/typescript.mjs +13 -2
- package/rules/vitest.mjs +84 -82
package/rules/node.mjs
CHANGED
|
@@ -22,10 +22,12 @@ export const nodeRules = {
|
|
|
22
22
|
|
|
23
23
|
// Disallow the use of process.env
|
|
24
24
|
// https://oxc.rs/docs/guide/usage/linter/rules/node/no-process-env.html
|
|
25
|
+
// Decision: too opinionated for general use
|
|
25
26
|
'node/no-process-env': 'off',
|
|
26
27
|
|
|
27
28
|
// Require require() to be called in the top-level module scope
|
|
28
29
|
// https://oxc.rs/docs/guide/usage/linter/rules/node/global-require.html
|
|
30
|
+
// Decision: restricts valid language feature
|
|
29
31
|
'node/global-require': 'off',
|
|
30
32
|
|
|
31
33
|
//eslint-plugin-n rules via jsPlugins
|
|
@@ -136,27 +138,27 @@ export const nodeRules = {
|
|
|
136
138
|
|
|
137
139
|
// Require error handling in callbacks
|
|
138
140
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/handle-callback-err.md
|
|
139
|
-
//
|
|
141
|
+
// Decision: handled by native node/handle-callback-err
|
|
140
142
|
'n/handle-callback-err': 'off',
|
|
141
143
|
|
|
142
144
|
// Disallow the assignment to exports
|
|
143
145
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-exports-assign.md
|
|
144
|
-
//
|
|
146
|
+
// Decision: handled by native node/no-exports-assign
|
|
145
147
|
'n/no-exports-assign': 'off',
|
|
146
148
|
|
|
147
149
|
// Disallow new operators with calls to require
|
|
148
150
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-new-require.md
|
|
149
|
-
//
|
|
151
|
+
// Decision: handled by native node/no-new-require
|
|
150
152
|
'n/no-new-require': 'off',
|
|
151
153
|
|
|
152
154
|
// Disallow string concatenation with __dirname and __filename
|
|
153
155
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-path-concat.md
|
|
154
|
-
//
|
|
156
|
+
// Decision: handled by native node/no-path-concat
|
|
155
157
|
'n/no-path-concat': 'off',
|
|
156
158
|
|
|
157
159
|
// Enforce file extensions in import declarations
|
|
158
160
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/file-extension-in-import.md
|
|
159
|
-
//
|
|
161
|
+
// Decision: handled by native import/extensions and import-x-js config
|
|
160
162
|
'n/file-extension-in-import': 'off',
|
|
161
163
|
|
|
162
164
|
// Disallow string callbacks in setTimeout/setInterval
|
|
@@ -165,27 +167,27 @@ export const nodeRules = {
|
|
|
165
167
|
|
|
166
168
|
// Disallow import declarations which import extraneous modules
|
|
167
169
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-extraneous-import.md
|
|
168
|
-
//
|
|
170
|
+
// Decision: handled by import-x-js/no-extraneous-dependencies
|
|
169
171
|
'n/no-extraneous-import': 'off',
|
|
170
172
|
|
|
171
173
|
// Disallow require() expressions which import extraneous modules
|
|
172
174
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-extraneous-require.md
|
|
173
|
-
//
|
|
175
|
+
// Decision: handled by import-x-js/no-extraneous-dependencies
|
|
174
176
|
'n/no-extraneous-require': 'off',
|
|
175
177
|
|
|
176
178
|
// Disallow import declarations which import non-existent modules
|
|
177
179
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-missing-import.md
|
|
178
|
-
//
|
|
180
|
+
// Decision: requires resolver configuration unavailable in oxlint jsPlugin runtime
|
|
179
181
|
'n/no-missing-import': 'off',
|
|
180
182
|
|
|
181
183
|
// Disallow require() expressions which import non-existent modules
|
|
182
184
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-missing-require.md
|
|
183
|
-
//
|
|
185
|
+
// Decision: requires resolver configuration unavailable in oxlint jsPlugin runtime
|
|
184
186
|
'n/no-missing-require': 'off',
|
|
185
187
|
|
|
186
188
|
// Disallow the use of process.env
|
|
187
189
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-process-env.md
|
|
188
|
-
//
|
|
190
|
+
// Decision: too restrictive for general use
|
|
189
191
|
'n/no-process-env': 'off',
|
|
190
192
|
|
|
191
193
|
// Disallow the use of process.exit()
|
|
@@ -194,7 +196,7 @@ export const nodeRules = {
|
|
|
194
196
|
|
|
195
197
|
// Disallow synchronous methods
|
|
196
198
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-sync.md
|
|
197
|
-
//
|
|
199
|
+
// Decision: too restrictive for general use
|
|
198
200
|
'n/no-sync': 'off',
|
|
199
201
|
|
|
200
202
|
// Enforce the use of the global crypto
|
|
@@ -207,12 +209,12 @@ export const nodeRules = {
|
|
|
207
209
|
|
|
208
210
|
// Disallow hiding core modules
|
|
209
211
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-hide-core-modules.md
|
|
210
|
-
//
|
|
212
|
+
// Decision: deprecated rule
|
|
211
213
|
'n/no-hide-core-modules': 'off',
|
|
212
214
|
|
|
213
215
|
// Require correct usage of hashbang (alias)
|
|
214
216
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/shebang.md
|
|
215
|
-
//
|
|
217
|
+
// Decision: handled by n/hashbang (shebang is a deprecated alias)
|
|
216
218
|
'n/shebang': 'off',
|
|
217
219
|
},
|
|
218
220
|
};
|
package/rules/promise.mjs
CHANGED
|
@@ -55,10 +55,12 @@ export const promiseRules = {
|
|
|
55
55
|
|
|
56
56
|
// Prefer await to then()/catch()/finally() for reading Promise values
|
|
57
57
|
// https://oxc.rs/docs/guide/usage/linter/rules/promise/prefer-await-to-then.html
|
|
58
|
+
// Decision: too opinionated for general use
|
|
58
59
|
'promise/prefer-await-to-then': 'off',
|
|
59
60
|
|
|
60
61
|
// Prefer async/await to the callback pattern
|
|
61
62
|
// https://oxc.rs/docs/guide/usage/linter/rules/promise/prefer-await-to-callbacks.html
|
|
63
|
+
// Decision: too opinionated for general use
|
|
62
64
|
'promise/prefer-await-to-callbacks': 'off',
|
|
63
65
|
|
|
64
66
|
// Disallow use of non-standard Promise static methods
|
package/rules/react-a11y.mjs
CHANGED
|
@@ -50,6 +50,7 @@ export const reactA11yRules = {
|
|
|
50
50
|
|
|
51
51
|
// Enforce that autocomplete attribute is correct
|
|
52
52
|
// https://oxc.rs/docs/guide/usage/linter/rules/jsx-a11y/autocomplete-valid.html
|
|
53
|
+
// Decision: too opinionated for general use
|
|
53
54
|
'jsx_a11y/autocomplete-valid': 'off',
|
|
54
55
|
|
|
55
56
|
// Enforce a clickable non-interactive element has at least one keyboard event listener
|
|
@@ -117,10 +118,6 @@ export const reactA11yRules = {
|
|
|
117
118
|
// https://oxc.rs/docs/guide/usage/linter/rules/jsx_a11y/interactive-supports-focus.html
|
|
118
119
|
'jsx_a11y/interactive-supports-focus': 'error',
|
|
119
120
|
|
|
120
|
-
// WAI-ARIA roles should not be used to convert a non-interactive element to interactive
|
|
121
|
-
// https://oxc.rs/docs/guide/usage/linter/rules/jsx_a11y/no-noninteractive-element-to-interactive-role.html
|
|
122
|
-
'jsx_a11y/no-noninteractive-element-to-interactive-role': 'error',
|
|
123
|
-
|
|
124
121
|
// Ensure interactive elements are not assigned non-interactive roles
|
|
125
122
|
// https://oxc.rs/docs/guide/usage/linter/rules/jsx-a11y/no-noninteractive-tabindex.html
|
|
126
123
|
'jsx_a11y/no-noninteractive-tabindex': [
|
|
@@ -153,7 +150,7 @@ export const reactA11yRules = {
|
|
|
153
150
|
|
|
154
151
|
// Prefer semantic HTML elements over role attributes
|
|
155
152
|
// https://oxc.rs/docs/guide/usage/linter/rules/jsx-a11y/prefer-tag-over-role.html
|
|
156
|
-
//
|
|
153
|
+
// Decision: left to implementer
|
|
157
154
|
'jsx_a11y/prefer-tag-over-role': 'off',
|
|
158
155
|
},
|
|
159
156
|
};
|
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,12 +98,11 @@ 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
|
|
|
114
108
|
// Disallow usage of the return value of ReactDOM.render
|
|
@@ -117,23 +111,21 @@ export const reactRules = {
|
|
|
117
111
|
|
|
118
112
|
// Disallow usage of setState
|
|
119
113
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/no-set-state.html
|
|
120
|
-
//
|
|
114
|
+
// Decision: this is too broad, should be enabled at a project level if desired
|
|
121
115
|
'react/no-set-state': 'off',
|
|
122
116
|
|
|
123
117
|
// Disallow using string references
|
|
124
118
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/no-string-refs.html
|
|
125
|
-
|
|
126
|
-
'react/no-string-refs': 'off',
|
|
119
|
+
'react/no-string-refs': 'error',
|
|
127
120
|
|
|
128
121
|
// Disallow this from being used in stateless functional components
|
|
129
122
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/no-this-in-sfc.html
|
|
130
|
-
//
|
|
123
|
+
// Decision: stylistic choice best left for formatter
|
|
131
124
|
'react/no-this-in-sfc': 'off',
|
|
132
125
|
|
|
133
126
|
// Disallow unescaped HTML entities from appearing in markup
|
|
134
127
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/no-unescaped-entities.html
|
|
135
|
-
|
|
136
|
-
'react/no-unescaped-entities': 'off',
|
|
128
|
+
'react/no-unescaped-entities': 'error',
|
|
137
129
|
|
|
138
130
|
// Disallow usage of unknown DOM property
|
|
139
131
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/no-unknown-property.html
|
|
@@ -141,8 +133,7 @@ export const reactRules = {
|
|
|
141
133
|
|
|
142
134
|
// Disallow usage of unsafe lifecycle methods
|
|
143
135
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/no-unsafe.html
|
|
144
|
-
|
|
145
|
-
'react/no-unsafe': 'off',
|
|
136
|
+
'react/no-unsafe': 'error',
|
|
146
137
|
|
|
147
138
|
// Disallow usage of deprecated methods
|
|
148
139
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/no-redundant-should-component-update.html
|
|
@@ -162,7 +153,7 @@ export const reactRules = {
|
|
|
162
153
|
|
|
163
154
|
// Disallow usage of React.Children APIs
|
|
164
155
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/no-react-children.html
|
|
165
|
-
//
|
|
156
|
+
// Decision: stylistic choice best left for formatter
|
|
166
157
|
'react/no-react-children': 'off',
|
|
167
158
|
|
|
168
159
|
// Disallow usage of cloneElement
|
|
@@ -171,22 +162,22 @@ export const reactRules = {
|
|
|
171
162
|
|
|
172
163
|
// Enforce ES5 or ES6 class for React Components
|
|
173
164
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/prefer-es6-class.html
|
|
174
|
-
//
|
|
165
|
+
// Decision: stylistic choice best left for formatter
|
|
175
166
|
'react/prefer-es6-class': 'off',
|
|
176
167
|
|
|
177
168
|
// Enforce that components that only export from react can only export components
|
|
178
169
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/only-export-components.html
|
|
179
|
-
//
|
|
170
|
+
// Decision: stylistic choice best left for formatter
|
|
180
171
|
'react/only-export-components': 'off',
|
|
181
172
|
|
|
182
173
|
// Prevent missing displayName in a React component definition
|
|
183
174
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/display-name.html
|
|
184
|
-
//
|
|
175
|
+
// Decision: stylistic choice best left for formatter (equivalent @eslint-react/no-missing-component-display-name is "off")
|
|
185
176
|
'react/display-name': 'off',
|
|
186
177
|
|
|
187
178
|
// Enforce a specific function type for function components
|
|
188
179
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/forward-ref-uses-ref.html
|
|
189
|
-
//
|
|
180
|
+
// Decision: stylistic choice best left for formatter
|
|
190
181
|
'react/forward-ref-uses-ref': 'off',
|
|
191
182
|
|
|
192
183
|
// Enforce sandbox attribute on iframe elements
|
|
@@ -195,7 +186,7 @@ export const reactRules = {
|
|
|
195
186
|
|
|
196
187
|
// Enforce checked/onChange or readonly for checkboxes
|
|
197
188
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/checked-requires-onchange-or-readonly.html
|
|
198
|
-
//
|
|
189
|
+
// Decision: stylistic choice best left for formatter
|
|
199
190
|
'react/checked-requires-onchange-or-readonly': 'off',
|
|
200
191
|
|
|
201
192
|
// Disallow void DOM elements from receiving children
|
|
@@ -204,7 +195,7 @@ export const reactRules = {
|
|
|
204
195
|
|
|
205
196
|
// Enforce component methods order
|
|
206
197
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/require-render-return.html
|
|
207
|
-
//
|
|
198
|
+
// Decision: stylistic choice best left for formatter
|
|
208
199
|
'react/require-render-return': 'off',
|
|
209
200
|
|
|
210
201
|
// Enforce Rules of Hooks
|
|
@@ -217,13 +208,12 @@ export const reactRules = {
|
|
|
217
208
|
|
|
218
209
|
// Enforce JSX filename extension (allow .jsx and .tsx)
|
|
219
210
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/jsx-filename-extension.html
|
|
220
|
-
//
|
|
211
|
+
// Decision: stylistic choice best left for formatter
|
|
221
212
|
'react/jsx-filename-extension': 'off',
|
|
222
213
|
|
|
223
214
|
// Enforce self-closing tags for components without children
|
|
224
215
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/self-closing-comp.html
|
|
225
|
-
|
|
226
|
-
'react/self-closing-comp': 'off',
|
|
216
|
+
'react/self-closing-comp': 'error',
|
|
227
217
|
|
|
228
218
|
// Enforce style prop value is an object
|
|
229
219
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/style-prop-object.html
|
|
@@ -231,39 +221,47 @@ export const reactRules = {
|
|
|
231
221
|
|
|
232
222
|
// Enforce event handler naming conventions in JSX
|
|
233
223
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/jsx-handler-names.html
|
|
234
|
-
//
|
|
224
|
+
// Decision: stylistic choice best left for formatter
|
|
235
225
|
'react/jsx-handler-names': 'off',
|
|
236
226
|
|
|
237
227
|
// Forbid certain props on components
|
|
238
228
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/forbid-component-props.html
|
|
229
|
+
// Decision: requires project-specific configuration
|
|
239
230
|
'react/forbid-component-props': 'off',
|
|
240
231
|
|
|
241
232
|
// Forbid certain props on DOM elements
|
|
242
233
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/forbid-dom-props.html
|
|
234
|
+
// Decision: requires project-specific configuration
|
|
243
235
|
'react/forbid-dom-props': 'off',
|
|
244
236
|
|
|
245
237
|
// Forbid certain elements
|
|
246
238
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/forbid-elements.html
|
|
239
|
+
// Decision: requires project-specific configuration
|
|
247
240
|
'react/forbid-elements': 'off',
|
|
248
241
|
|
|
249
242
|
// Enforce destructuring assignment of useState hook
|
|
250
243
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/hook-use-state.html
|
|
244
|
+
// Decision: too opinionated for general use
|
|
251
245
|
'react/hook-use-state': 'off',
|
|
252
246
|
|
|
253
247
|
// Disallow usage of setState in componentDidUpdate (deprecated lifecycle)
|
|
254
248
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/no-did-update-set-state.html
|
|
249
|
+
// Decision: deprecated lifecycle method
|
|
255
250
|
'react/no-did-update-set-state': 'off',
|
|
256
251
|
|
|
257
252
|
// Prefer function components over class components
|
|
258
253
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/prefer-function-component.html
|
|
254
|
+
// Decision: too opinionated for general use
|
|
259
255
|
'react/prefer-function-component': 'off',
|
|
260
256
|
|
|
261
257
|
// Disallow missing React when using JSX (not needed with modern React)
|
|
262
258
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/react-in-jsx-scope.html
|
|
259
|
+
// Decision: not needed with modern React JSX transform
|
|
263
260
|
'react/react-in-jsx-scope': 'off',
|
|
264
261
|
|
|
265
262
|
// Enforce state initialization in constructor
|
|
266
263
|
// https://oxc.rs/docs/guide/usage/linter/rules/react/state-in-constructor.html
|
|
264
|
+
// Decision: too opinionated for general use
|
|
267
265
|
'react/state-in-constructor': 'off',
|
|
268
266
|
|
|
269
267
|
//rules via jsPlugins (@eslint-react/eslint-plugin)
|
|
@@ -278,7 +276,7 @@ export const reactRules = {
|
|
|
278
276
|
|
|
279
277
|
// Verify the list of the dependencies for Hooks like useEffect and similar
|
|
280
278
|
// https://eslint-react.xyz/docs/rules/exhaustive-deps
|
|
281
|
-
//
|
|
279
|
+
// Decision: handled by native react/exhaustive-deps
|
|
282
280
|
'@eslint-react/exhaustive-deps': 'off',
|
|
283
281
|
|
|
284
282
|
// Validates against mutating props, state, and other immutable values
|
|
@@ -287,7 +285,7 @@ export const reactRules = {
|
|
|
287
285
|
|
|
288
286
|
// Prevent accidental JS comments from being injected into JSX as text
|
|
289
287
|
// https://eslint-react.xyz/docs/rules/jsx-no-comment-textnodes
|
|
290
|
-
//
|
|
288
|
+
// Decision: handled by native react/jsx-no-comment-textnodes
|
|
291
289
|
'@eslint-react/jsx-no-comment-textnodes': 'off',
|
|
292
290
|
|
|
293
291
|
// Prevents unintentional '$' sign before expression in JSX
|
|
@@ -300,7 +298,7 @@ export const reactRules = {
|
|
|
300
298
|
|
|
301
299
|
// Prevent passing of children as props
|
|
302
300
|
// https://eslint-react.xyz/docs/rules/jsx-no-children-prop
|
|
303
|
-
//
|
|
301
|
+
// Decision: handled by native react/no-children-prop
|
|
304
302
|
'@eslint-react/jsx-no-children-prop': 'off',
|
|
305
303
|
|
|
306
304
|
// Prevent children prop used alongside children in JSX
|
|
@@ -317,7 +315,7 @@ export const reactRules = {
|
|
|
317
315
|
|
|
318
316
|
// Disallow namespace in JSX
|
|
319
317
|
// https://eslint-react.xyz/docs/rules/jsx-no-namespace
|
|
320
|
-
//
|
|
318
|
+
// Decision: handled by native react/no-namespace
|
|
321
319
|
'@eslint-react/jsx-no-namespace': 'off',
|
|
322
320
|
|
|
323
321
|
// Prevent using this.state within a this.setState
|
|
@@ -326,7 +324,7 @@ export const reactRules = {
|
|
|
326
324
|
|
|
327
325
|
// Prevent usage of Array index in keys
|
|
328
326
|
// https://eslint-react.xyz/docs/rules/no-array-index-key
|
|
329
|
-
//
|
|
327
|
+
// Decision: handled by native react/no-array-index-key
|
|
330
328
|
'@eslint-react/no-array-index-key': 'off',
|
|
331
329
|
|
|
332
330
|
// Disallow usage of Children.count
|
|
@@ -355,7 +353,7 @@ export const reactRules = {
|
|
|
355
353
|
|
|
356
354
|
// Disallow usage of cloneElement
|
|
357
355
|
// https://eslint-react.xyz/docs/rules/no-clone-element
|
|
358
|
-
//
|
|
356
|
+
// Decision: handled by native react/no-clone-element
|
|
359
357
|
'@eslint-react/no-clone-element': 'off',
|
|
360
358
|
|
|
361
359
|
// Disallow usage of componentWillMount
|
|
@@ -380,7 +378,7 @@ export const reactRules = {
|
|
|
380
378
|
|
|
381
379
|
// Prevent direct mutation of this.state
|
|
382
380
|
// https://eslint-react.xyz/docs/rules/no-direct-mutation-state
|
|
383
|
-
//
|
|
381
|
+
// Decision: handled by native react/no-direct-mutation-state
|
|
384
382
|
'@eslint-react/no-direct-mutation-state': 'off',
|
|
385
383
|
|
|
386
384
|
// Disallow duplicate keys in JSX arrays
|
|
@@ -393,35 +391,37 @@ export const reactRules = {
|
|
|
393
391
|
|
|
394
392
|
// Prevent implicitly passing the children prop
|
|
395
393
|
// https://eslint-react.xyz/docs/rules/no-implicit-children
|
|
396
|
-
//
|
|
394
|
+
// Decision: requires TypeScript type-checker services unavailable in oxlint jsPlugin runtime
|
|
397
395
|
'@eslint-react/no-implicit-children': 'off',
|
|
398
396
|
|
|
399
397
|
// Prevent implicitly passing the key prop
|
|
400
398
|
// https://eslint-react.xyz/docs/rules/no-implicit-key
|
|
401
|
-
//
|
|
399
|
+
// Decision: requires TypeScript type-checker services unavailable in oxlint jsPlugin runtime
|
|
402
400
|
'@eslint-react/no-implicit-key': 'off',
|
|
403
401
|
|
|
404
402
|
// Prevent implicitly passing the ref prop
|
|
405
403
|
// https://eslint-react.xyz/docs/rules/no-implicit-ref
|
|
406
|
-
//
|
|
404
|
+
// Decision: requires TypeScript type-checker services unavailable in oxlint jsPlugin runtime
|
|
407
405
|
'@eslint-react/no-implicit-ref': 'off',
|
|
408
406
|
|
|
409
407
|
// Prevent problematic leaked values from being rendered
|
|
410
408
|
// https://eslint-react.xyz/docs/rules/no-leaked-conditional-rendering
|
|
411
|
-
//
|
|
409
|
+
// Decision: requires TypeScript type-checker services unavailable in oxlint jsPlugin runtime
|
|
412
410
|
'@eslint-react/no-leaked-conditional-rendering': 'off',
|
|
413
411
|
|
|
414
412
|
// Enforce that components have a displayName for DevTools
|
|
415
413
|
// https://eslint-react.xyz/docs/rules/no-missing-component-display-name
|
|
414
|
+
// Decision: too opinionated for general use
|
|
416
415
|
'@eslint-react/no-missing-component-display-name': 'off',
|
|
417
416
|
|
|
418
417
|
// Enforce that contexts have a displayName for DevTools
|
|
419
418
|
// https://eslint-react.xyz/docs/rules/no-missing-context-display-name
|
|
419
|
+
// Decision: too opinionated for general use
|
|
420
420
|
'@eslint-react/no-missing-context-display-name': 'off',
|
|
421
421
|
|
|
422
422
|
// Enforce that every JSX element in a list has a key prop
|
|
423
423
|
// https://eslint-react.xyz/docs/rules/no-missing-key
|
|
424
|
-
//
|
|
424
|
+
// Decision: handled by native react/jsx-key
|
|
425
425
|
'@eslint-react/no-missing-key': 'off',
|
|
426
426
|
|
|
427
427
|
// Disallow misusing captureOwnerStack
|
|
@@ -438,7 +438,7 @@ export const reactRules = {
|
|
|
438
438
|
|
|
439
439
|
// Prevent usage of setState in componentDidMount
|
|
440
440
|
// https://eslint-react.xyz/docs/rules/no-set-state-in-component-did-mount
|
|
441
|
-
//
|
|
441
|
+
// Decision: handled by native react/no-did-mount-set-state
|
|
442
442
|
'@eslint-react/no-set-state-in-component-did-mount': 'off',
|
|
443
443
|
|
|
444
444
|
// Prevent usage of setState in componentDidUpdate
|
|
@@ -447,7 +447,7 @@ export const reactRules = {
|
|
|
447
447
|
|
|
448
448
|
// Prevent usage of setState in componentWillUpdate
|
|
449
449
|
// https://eslint-react.xyz/docs/rules/no-set-state-in-component-will-update
|
|
450
|
-
//
|
|
450
|
+
// Decision: handled by native react/no-will-update-set-state
|
|
451
451
|
'@eslint-react/no-set-state-in-component-will-update': 'off',
|
|
452
452
|
|
|
453
453
|
// Disallow unnecessary "use" prefix on custom hooks
|
|
@@ -468,7 +468,7 @@ export const reactRules = {
|
|
|
468
468
|
|
|
469
469
|
// Prevent non-stable values used as context values
|
|
470
470
|
// https://eslint-react.xyz/docs/rules/no-unstable-context-value
|
|
471
|
-
//
|
|
471
|
+
// Decision: handled by native react/jsx-no-constructed-context-values
|
|
472
472
|
'@eslint-react/no-unstable-context-value': 'off',
|
|
473
473
|
|
|
474
474
|
// Disallow referential-type variables as default props
|
|
@@ -481,7 +481,7 @@ export const reactRules = {
|
|
|
481
481
|
|
|
482
482
|
// Warn about component props that are defined but never used
|
|
483
483
|
// https://eslint-react.xyz/docs/rules/no-unused-props
|
|
484
|
-
//
|
|
484
|
+
// Decision: requires TypeScript type-checker services unavailable in oxlint jsPlugin runtime
|
|
485
485
|
'@eslint-react/no-unused-props': 'off',
|
|
486
486
|
|
|
487
487
|
// Prevent unused state values
|
|
@@ -502,7 +502,7 @@ export const reactRules = {
|
|
|
502
502
|
|
|
503
503
|
// Enforce Rules of Hooks
|
|
504
504
|
// https://eslint-react.xyz/docs/rules/rules-of-hooks
|
|
505
|
-
//
|
|
505
|
+
// Decision: handled by native react/rules-of-hooks
|
|
506
506
|
'@eslint-react/rules-of-hooks': 'off',
|
|
507
507
|
|
|
508
508
|
// Validates against calling setState synchronously in an effect
|
|
@@ -533,17 +533,17 @@ export const reactRules = {
|
|
|
533
533
|
|
|
534
534
|
// Warn on usage of dangerouslySetInnerHTML
|
|
535
535
|
// https://eslint-react.xyz/docs/rules/dom-no-dangerously-set-innerhtml
|
|
536
|
-
//
|
|
536
|
+
// Decision: handled by native react/no-danger
|
|
537
537
|
'@eslint-react/dom-no-dangerously-set-innerhtml': 'off',
|
|
538
538
|
|
|
539
539
|
// Prevent problem with children and dangerouslySetInnerHTML
|
|
540
540
|
// https://eslint-react.xyz/docs/rules/dom-no-dangerously-set-innerhtml-with-children
|
|
541
|
-
//
|
|
541
|
+
// Decision: handled by native react/no-danger-with-children
|
|
542
542
|
'@eslint-react/dom-no-dangerously-set-innerhtml-with-children': 'off',
|
|
543
543
|
|
|
544
544
|
// Warn against using findDOMNode()
|
|
545
545
|
// https://eslint-react.xyz/docs/rules/dom-no-find-dom-node
|
|
546
|
-
//
|
|
546
|
+
// Decision: handled by native react/no-find-dom-node
|
|
547
547
|
'@eslint-react/dom-no-find-dom-node': 'off',
|
|
548
548
|
|
|
549
549
|
// Disallow usage of flushSync
|
|
@@ -556,12 +556,12 @@ export const reactRules = {
|
|
|
556
556
|
|
|
557
557
|
// Enforce that buttons have an explicit type attribute
|
|
558
558
|
// https://eslint-react.xyz/docs/rules/dom-no-missing-button-type
|
|
559
|
-
//
|
|
559
|
+
// Decision: handled by native react/button-has-type
|
|
560
560
|
'@eslint-react/dom-no-missing-button-type': 'off',
|
|
561
561
|
|
|
562
562
|
// Enforce sandbox attribute on iframe elements
|
|
563
563
|
// https://eslint-react.xyz/docs/rules/dom-no-missing-iframe-sandbox
|
|
564
|
-
//
|
|
564
|
+
// Decision: handled by native react/iframe-missing-sandbox
|
|
565
565
|
'@eslint-react/dom-no-missing-iframe-sandbox': 'off',
|
|
566
566
|
|
|
567
567
|
// Disallow usage of ReactDOM.render (use createRoot instead)
|
|
@@ -570,22 +570,22 @@ export const reactRules = {
|
|
|
570
570
|
|
|
571
571
|
// Disallow using ReactDOM.render return value
|
|
572
572
|
// https://eslint-react.xyz/docs/rules/dom-no-render-return-value
|
|
573
|
-
//
|
|
573
|
+
// Decision: handled by native react/no-render-return-value
|
|
574
574
|
'@eslint-react/dom-no-render-return-value': 'off',
|
|
575
575
|
|
|
576
576
|
// Prevent usage of javascript: URLs
|
|
577
577
|
// https://eslint-react.xyz/docs/rules/dom-no-script-url
|
|
578
|
-
//
|
|
578
|
+
// Decision: handled by native react/jsx-no-script-url
|
|
579
579
|
'@eslint-react/dom-no-script-url': 'off',
|
|
580
580
|
|
|
581
581
|
// Require style prop value be an object
|
|
582
582
|
// https://eslint-react.xyz/docs/rules/dom-no-string-style-prop
|
|
583
|
-
//
|
|
583
|
+
// Decision: handled by native react/style-prop-object
|
|
584
584
|
'@eslint-react/dom-no-string-style-prop': 'off',
|
|
585
585
|
|
|
586
586
|
// Prevent usage of unknown DOM property
|
|
587
587
|
// https://eslint-react.xyz/docs/rules/dom-no-unknown-property
|
|
588
|
-
//
|
|
588
|
+
// Decision: handled by native react/no-unknown-property
|
|
589
589
|
'@eslint-react/dom-no-unknown-property': 'off',
|
|
590
590
|
|
|
591
591
|
// Enforce safe iframe sandbox attribute values
|
|
@@ -594,7 +594,7 @@ export const reactRules = {
|
|
|
594
594
|
|
|
595
595
|
// Disallow target="_blank" without rel="noreferrer"
|
|
596
596
|
// https://eslint-react.xyz/docs/rules/dom-no-unsafe-target-blank
|
|
597
|
-
//
|
|
597
|
+
// Decision: handled by native react/jsx-no-target-blank
|
|
598
598
|
'@eslint-react/dom-no-unsafe-target-blank': 'off',
|
|
599
599
|
|
|
600
600
|
// Disallow usage of deprecated useFormState (use useActionState instead)
|
|
@@ -603,7 +603,7 @@ export const reactRules = {
|
|
|
603
603
|
|
|
604
604
|
// Prevent void DOM elements from receiving children
|
|
605
605
|
// https://eslint-react.xyz/docs/rules/dom-no-void-elements-with-children
|
|
606
|
-
//
|
|
606
|
+
// Decision: handled by native react/void-dom-elements-no-children
|
|
607
607
|
'@eslint-react/dom-no-void-elements-with-children': 'off',
|
|
608
608
|
|
|
609
609
|
// --- RSC rules ---
|