@wistia/oxlint-config 0.7.3 → 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 +223 -2
- package/rules/import.mjs +100 -38
- package/rules/node.mjs +23 -13
- package/rules/promise.mjs +2 -0
- package/rules/react-a11y.mjs +6 -1
- package/rules/react.mjs +95 -63
- package/rules/typescript.mjs +45 -2
- package/rules/vitest.mjs +84 -82
package/rules/node.mjs
CHANGED
|
@@ -20,6 +20,16 @@ export const nodeRules = {
|
|
|
20
20
|
// https://oxc.rs/docs/guide/usage/linter/rules/node/no-path-concat.html
|
|
21
21
|
'node/no-path-concat': 'error',
|
|
22
22
|
|
|
23
|
+
// Disallow the use of process.env
|
|
24
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/node/no-process-env.html
|
|
25
|
+
// Decision: too opinionated for general use
|
|
26
|
+
'node/no-process-env': 'off',
|
|
27
|
+
|
|
28
|
+
// Require require() to be called in the top-level module scope
|
|
29
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/node/global-require.html
|
|
30
|
+
// Decision: restricts valid language feature
|
|
31
|
+
'node/global-require': 'off',
|
|
32
|
+
|
|
23
33
|
//eslint-plugin-n rules via jsPlugins
|
|
24
34
|
|
|
25
35
|
// Disallow deprecated APIs
|
|
@@ -128,27 +138,27 @@ export const nodeRules = {
|
|
|
128
138
|
|
|
129
139
|
// Require error handling in callbacks
|
|
130
140
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/handle-callback-err.md
|
|
131
|
-
//
|
|
141
|
+
// Decision: handled by native node/handle-callback-err
|
|
132
142
|
'n/handle-callback-err': 'off',
|
|
133
143
|
|
|
134
144
|
// Disallow the assignment to exports
|
|
135
145
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-exports-assign.md
|
|
136
|
-
//
|
|
146
|
+
// Decision: handled by native node/no-exports-assign
|
|
137
147
|
'n/no-exports-assign': 'off',
|
|
138
148
|
|
|
139
149
|
// Disallow new operators with calls to require
|
|
140
150
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-new-require.md
|
|
141
|
-
//
|
|
151
|
+
// Decision: handled by native node/no-new-require
|
|
142
152
|
'n/no-new-require': 'off',
|
|
143
153
|
|
|
144
154
|
// Disallow string concatenation with __dirname and __filename
|
|
145
155
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-path-concat.md
|
|
146
|
-
//
|
|
156
|
+
// Decision: handled by native node/no-path-concat
|
|
147
157
|
'n/no-path-concat': 'off',
|
|
148
158
|
|
|
149
159
|
// Enforce file extensions in import declarations
|
|
150
160
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/file-extension-in-import.md
|
|
151
|
-
//
|
|
161
|
+
// Decision: handled by native import/extensions and import-x-js config
|
|
152
162
|
'n/file-extension-in-import': 'off',
|
|
153
163
|
|
|
154
164
|
// Disallow string callbacks in setTimeout/setInterval
|
|
@@ -157,27 +167,27 @@ export const nodeRules = {
|
|
|
157
167
|
|
|
158
168
|
// Disallow import declarations which import extraneous modules
|
|
159
169
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-extraneous-import.md
|
|
160
|
-
//
|
|
170
|
+
// Decision: handled by import-x-js/no-extraneous-dependencies
|
|
161
171
|
'n/no-extraneous-import': 'off',
|
|
162
172
|
|
|
163
173
|
// Disallow require() expressions which import extraneous modules
|
|
164
174
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-extraneous-require.md
|
|
165
|
-
//
|
|
175
|
+
// Decision: handled by import-x-js/no-extraneous-dependencies
|
|
166
176
|
'n/no-extraneous-require': 'off',
|
|
167
177
|
|
|
168
178
|
// Disallow import declarations which import non-existent modules
|
|
169
179
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-missing-import.md
|
|
170
|
-
//
|
|
180
|
+
// Decision: requires resolver configuration unavailable in oxlint jsPlugin runtime
|
|
171
181
|
'n/no-missing-import': 'off',
|
|
172
182
|
|
|
173
183
|
// Disallow require() expressions which import non-existent modules
|
|
174
184
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-missing-require.md
|
|
175
|
-
//
|
|
185
|
+
// Decision: requires resolver configuration unavailable in oxlint jsPlugin runtime
|
|
176
186
|
'n/no-missing-require': 'off',
|
|
177
187
|
|
|
178
188
|
// Disallow the use of process.env
|
|
179
189
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-process-env.md
|
|
180
|
-
//
|
|
190
|
+
// Decision: too restrictive for general use
|
|
181
191
|
'n/no-process-env': 'off',
|
|
182
192
|
|
|
183
193
|
// Disallow the use of process.exit()
|
|
@@ -186,7 +196,7 @@ export const nodeRules = {
|
|
|
186
196
|
|
|
187
197
|
// Disallow synchronous methods
|
|
188
198
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-sync.md
|
|
189
|
-
//
|
|
199
|
+
// Decision: too restrictive for general use
|
|
190
200
|
'n/no-sync': 'off',
|
|
191
201
|
|
|
192
202
|
// Enforce the use of the global crypto
|
|
@@ -199,12 +209,12 @@ export const nodeRules = {
|
|
|
199
209
|
|
|
200
210
|
// Disallow hiding core modules
|
|
201
211
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-hide-core-modules.md
|
|
202
|
-
//
|
|
212
|
+
// Decision: deprecated rule
|
|
203
213
|
'n/no-hide-core-modules': 'off',
|
|
204
214
|
|
|
205
215
|
// Require correct usage of hashbang (alias)
|
|
206
216
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/shebang.md
|
|
207
|
-
//
|
|
217
|
+
// Decision: handled by n/hashbang (shebang is a deprecated alias)
|
|
208
218
|
'n/shebang': 'off',
|
|
209
219
|
},
|
|
210
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
|
|
@@ -113,6 +114,10 @@ export const reactA11yRules = {
|
|
|
113
114
|
// https://oxc.rs/docs/guide/usage/linter/rules/jsx-a11y/tabindex-no-positive.html
|
|
114
115
|
'jsx_a11y/tabindex-no-positive': 'error',
|
|
115
116
|
|
|
117
|
+
// Elements with an interactive role and interaction handlers must be focusable
|
|
118
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/jsx_a11y/interactive-supports-focus.html
|
|
119
|
+
'jsx_a11y/interactive-supports-focus': 'error',
|
|
120
|
+
|
|
116
121
|
// Ensure interactive elements are not assigned non-interactive roles
|
|
117
122
|
// https://oxc.rs/docs/guide/usage/linter/rules/jsx-a11y/no-noninteractive-tabindex.html
|
|
118
123
|
'jsx_a11y/no-noninteractive-tabindex': [
|
|
@@ -145,7 +150,7 @@ export const reactA11yRules = {
|
|
|
145
150
|
|
|
146
151
|
// Prefer semantic HTML elements over role attributes
|
|
147
152
|
// https://oxc.rs/docs/guide/usage/linter/rules/jsx-a11y/prefer-tag-over-role.html
|
|
148
|
-
//
|
|
153
|
+
// Decision: left to implementer
|
|
149
154
|
'jsx_a11y/prefer-tag-over-role': 'off',
|
|
150
155
|
},
|
|
151
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,9 +221,49 @@ 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
|
|
|
227
|
+
// Forbid certain props on components
|
|
228
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/react/forbid-component-props.html
|
|
229
|
+
// Decision: requires project-specific configuration
|
|
230
|
+
'react/forbid-component-props': 'off',
|
|
231
|
+
|
|
232
|
+
// Forbid certain props on DOM elements
|
|
233
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/react/forbid-dom-props.html
|
|
234
|
+
// Decision: requires project-specific configuration
|
|
235
|
+
'react/forbid-dom-props': 'off',
|
|
236
|
+
|
|
237
|
+
// Forbid certain elements
|
|
238
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/react/forbid-elements.html
|
|
239
|
+
// Decision: requires project-specific configuration
|
|
240
|
+
'react/forbid-elements': 'off',
|
|
241
|
+
|
|
242
|
+
// Enforce destructuring assignment of useState hook
|
|
243
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/react/hook-use-state.html
|
|
244
|
+
// Decision: too opinionated for general use
|
|
245
|
+
'react/hook-use-state': 'off',
|
|
246
|
+
|
|
247
|
+
// Disallow usage of setState in componentDidUpdate (deprecated lifecycle)
|
|
248
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/react/no-did-update-set-state.html
|
|
249
|
+
// Decision: deprecated lifecycle method
|
|
250
|
+
'react/no-did-update-set-state': 'off',
|
|
251
|
+
|
|
252
|
+
// Prefer function components over class components
|
|
253
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/react/prefer-function-component.html
|
|
254
|
+
// Decision: too opinionated for general use
|
|
255
|
+
'react/prefer-function-component': 'off',
|
|
256
|
+
|
|
257
|
+
// Disallow missing React when using JSX (not needed with modern React)
|
|
258
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/react/react-in-jsx-scope.html
|
|
259
|
+
// Decision: not needed with modern React JSX transform
|
|
260
|
+
'react/react-in-jsx-scope': 'off',
|
|
261
|
+
|
|
262
|
+
// Enforce state initialization in constructor
|
|
263
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/react/state-in-constructor.html
|
|
264
|
+
// Decision: too opinionated for general use
|
|
265
|
+
'react/state-in-constructor': 'off',
|
|
266
|
+
|
|
237
267
|
//rules via jsPlugins (@eslint-react/eslint-plugin)
|
|
238
268
|
|
|
239
269
|
// Validates usage of Error Boundaries instead of try/catch for child errors
|
|
@@ -246,7 +276,7 @@ export const reactRules = {
|
|
|
246
276
|
|
|
247
277
|
// Verify the list of the dependencies for Hooks like useEffect and similar
|
|
248
278
|
// https://eslint-react.xyz/docs/rules/exhaustive-deps
|
|
249
|
-
//
|
|
279
|
+
// Decision: handled by native react/exhaustive-deps
|
|
250
280
|
'@eslint-react/exhaustive-deps': 'off',
|
|
251
281
|
|
|
252
282
|
// Validates against mutating props, state, and other immutable values
|
|
@@ -255,7 +285,7 @@ export const reactRules = {
|
|
|
255
285
|
|
|
256
286
|
// Prevent accidental JS comments from being injected into JSX as text
|
|
257
287
|
// https://eslint-react.xyz/docs/rules/jsx-no-comment-textnodes
|
|
258
|
-
//
|
|
288
|
+
// Decision: handled by native react/jsx-no-comment-textnodes
|
|
259
289
|
'@eslint-react/jsx-no-comment-textnodes': 'off',
|
|
260
290
|
|
|
261
291
|
// Prevents unintentional '$' sign before expression in JSX
|
|
@@ -268,7 +298,7 @@ export const reactRules = {
|
|
|
268
298
|
|
|
269
299
|
// Prevent passing of children as props
|
|
270
300
|
// https://eslint-react.xyz/docs/rules/jsx-no-children-prop
|
|
271
|
-
//
|
|
301
|
+
// Decision: handled by native react/no-children-prop
|
|
272
302
|
'@eslint-react/jsx-no-children-prop': 'off',
|
|
273
303
|
|
|
274
304
|
// Prevent children prop used alongside children in JSX
|
|
@@ -285,7 +315,7 @@ export const reactRules = {
|
|
|
285
315
|
|
|
286
316
|
// Disallow namespace in JSX
|
|
287
317
|
// https://eslint-react.xyz/docs/rules/jsx-no-namespace
|
|
288
|
-
//
|
|
318
|
+
// Decision: handled by native react/no-namespace
|
|
289
319
|
'@eslint-react/jsx-no-namespace': 'off',
|
|
290
320
|
|
|
291
321
|
// Prevent using this.state within a this.setState
|
|
@@ -294,7 +324,7 @@ export const reactRules = {
|
|
|
294
324
|
|
|
295
325
|
// Prevent usage of Array index in keys
|
|
296
326
|
// https://eslint-react.xyz/docs/rules/no-array-index-key
|
|
297
|
-
//
|
|
327
|
+
// Decision: handled by native react/no-array-index-key
|
|
298
328
|
'@eslint-react/no-array-index-key': 'off',
|
|
299
329
|
|
|
300
330
|
// Disallow usage of Children.count
|
|
@@ -323,7 +353,7 @@ export const reactRules = {
|
|
|
323
353
|
|
|
324
354
|
// Disallow usage of cloneElement
|
|
325
355
|
// https://eslint-react.xyz/docs/rules/no-clone-element
|
|
326
|
-
//
|
|
356
|
+
// Decision: handled by native react/no-clone-element
|
|
327
357
|
'@eslint-react/no-clone-element': 'off',
|
|
328
358
|
|
|
329
359
|
// Disallow usage of componentWillMount
|
|
@@ -348,7 +378,7 @@ export const reactRules = {
|
|
|
348
378
|
|
|
349
379
|
// Prevent direct mutation of this.state
|
|
350
380
|
// https://eslint-react.xyz/docs/rules/no-direct-mutation-state
|
|
351
|
-
//
|
|
381
|
+
// Decision: handled by native react/no-direct-mutation-state
|
|
352
382
|
'@eslint-react/no-direct-mutation-state': 'off',
|
|
353
383
|
|
|
354
384
|
// Disallow duplicate keys in JSX arrays
|
|
@@ -361,35 +391,37 @@ export const reactRules = {
|
|
|
361
391
|
|
|
362
392
|
// Prevent implicitly passing the children prop
|
|
363
393
|
// https://eslint-react.xyz/docs/rules/no-implicit-children
|
|
364
|
-
//
|
|
394
|
+
// Decision: requires TypeScript type-checker services unavailable in oxlint jsPlugin runtime
|
|
365
395
|
'@eslint-react/no-implicit-children': 'off',
|
|
366
396
|
|
|
367
397
|
// Prevent implicitly passing the key prop
|
|
368
398
|
// https://eslint-react.xyz/docs/rules/no-implicit-key
|
|
369
|
-
//
|
|
399
|
+
// Decision: requires TypeScript type-checker services unavailable in oxlint jsPlugin runtime
|
|
370
400
|
'@eslint-react/no-implicit-key': 'off',
|
|
371
401
|
|
|
372
402
|
// Prevent implicitly passing the ref prop
|
|
373
403
|
// https://eslint-react.xyz/docs/rules/no-implicit-ref
|
|
374
|
-
//
|
|
404
|
+
// Decision: requires TypeScript type-checker services unavailable in oxlint jsPlugin runtime
|
|
375
405
|
'@eslint-react/no-implicit-ref': 'off',
|
|
376
406
|
|
|
377
407
|
// Prevent problematic leaked values from being rendered
|
|
378
408
|
// https://eslint-react.xyz/docs/rules/no-leaked-conditional-rendering
|
|
379
|
-
//
|
|
409
|
+
// Decision: requires TypeScript type-checker services unavailable in oxlint jsPlugin runtime
|
|
380
410
|
'@eslint-react/no-leaked-conditional-rendering': 'off',
|
|
381
411
|
|
|
382
412
|
// Enforce that components have a displayName for DevTools
|
|
383
413
|
// https://eslint-react.xyz/docs/rules/no-missing-component-display-name
|
|
414
|
+
// Decision: too opinionated for general use
|
|
384
415
|
'@eslint-react/no-missing-component-display-name': 'off',
|
|
385
416
|
|
|
386
417
|
// Enforce that contexts have a displayName for DevTools
|
|
387
418
|
// https://eslint-react.xyz/docs/rules/no-missing-context-display-name
|
|
419
|
+
// Decision: too opinionated for general use
|
|
388
420
|
'@eslint-react/no-missing-context-display-name': 'off',
|
|
389
421
|
|
|
390
422
|
// Enforce that every JSX element in a list has a key prop
|
|
391
423
|
// https://eslint-react.xyz/docs/rules/no-missing-key
|
|
392
|
-
//
|
|
424
|
+
// Decision: handled by native react/jsx-key
|
|
393
425
|
'@eslint-react/no-missing-key': 'off',
|
|
394
426
|
|
|
395
427
|
// Disallow misusing captureOwnerStack
|
|
@@ -406,7 +438,7 @@ export const reactRules = {
|
|
|
406
438
|
|
|
407
439
|
// Prevent usage of setState in componentDidMount
|
|
408
440
|
// https://eslint-react.xyz/docs/rules/no-set-state-in-component-did-mount
|
|
409
|
-
//
|
|
441
|
+
// Decision: handled by native react/no-did-mount-set-state
|
|
410
442
|
'@eslint-react/no-set-state-in-component-did-mount': 'off',
|
|
411
443
|
|
|
412
444
|
// Prevent usage of setState in componentDidUpdate
|
|
@@ -415,7 +447,7 @@ export const reactRules = {
|
|
|
415
447
|
|
|
416
448
|
// Prevent usage of setState in componentWillUpdate
|
|
417
449
|
// https://eslint-react.xyz/docs/rules/no-set-state-in-component-will-update
|
|
418
|
-
//
|
|
450
|
+
// Decision: handled by native react/no-will-update-set-state
|
|
419
451
|
'@eslint-react/no-set-state-in-component-will-update': 'off',
|
|
420
452
|
|
|
421
453
|
// Disallow unnecessary "use" prefix on custom hooks
|
|
@@ -436,7 +468,7 @@ export const reactRules = {
|
|
|
436
468
|
|
|
437
469
|
// Prevent non-stable values used as context values
|
|
438
470
|
// https://eslint-react.xyz/docs/rules/no-unstable-context-value
|
|
439
|
-
//
|
|
471
|
+
// Decision: handled by native react/jsx-no-constructed-context-values
|
|
440
472
|
'@eslint-react/no-unstable-context-value': 'off',
|
|
441
473
|
|
|
442
474
|
// Disallow referential-type variables as default props
|
|
@@ -449,7 +481,7 @@ export const reactRules = {
|
|
|
449
481
|
|
|
450
482
|
// Warn about component props that are defined but never used
|
|
451
483
|
// https://eslint-react.xyz/docs/rules/no-unused-props
|
|
452
|
-
//
|
|
484
|
+
// Decision: requires TypeScript type-checker services unavailable in oxlint jsPlugin runtime
|
|
453
485
|
'@eslint-react/no-unused-props': 'off',
|
|
454
486
|
|
|
455
487
|
// Prevent unused state values
|
|
@@ -470,7 +502,7 @@ export const reactRules = {
|
|
|
470
502
|
|
|
471
503
|
// Enforce Rules of Hooks
|
|
472
504
|
// https://eslint-react.xyz/docs/rules/rules-of-hooks
|
|
473
|
-
//
|
|
505
|
+
// Decision: handled by native react/rules-of-hooks
|
|
474
506
|
'@eslint-react/rules-of-hooks': 'off',
|
|
475
507
|
|
|
476
508
|
// Validates against calling setState synchronously in an effect
|
|
@@ -501,17 +533,17 @@ export const reactRules = {
|
|
|
501
533
|
|
|
502
534
|
// Warn on usage of dangerouslySetInnerHTML
|
|
503
535
|
// https://eslint-react.xyz/docs/rules/dom-no-dangerously-set-innerhtml
|
|
504
|
-
//
|
|
536
|
+
// Decision: handled by native react/no-danger
|
|
505
537
|
'@eslint-react/dom-no-dangerously-set-innerhtml': 'off',
|
|
506
538
|
|
|
507
539
|
// Prevent problem with children and dangerouslySetInnerHTML
|
|
508
540
|
// https://eslint-react.xyz/docs/rules/dom-no-dangerously-set-innerhtml-with-children
|
|
509
|
-
//
|
|
541
|
+
// Decision: handled by native react/no-danger-with-children
|
|
510
542
|
'@eslint-react/dom-no-dangerously-set-innerhtml-with-children': 'off',
|
|
511
543
|
|
|
512
544
|
// Warn against using findDOMNode()
|
|
513
545
|
// https://eslint-react.xyz/docs/rules/dom-no-find-dom-node
|
|
514
|
-
//
|
|
546
|
+
// Decision: handled by native react/no-find-dom-node
|
|
515
547
|
'@eslint-react/dom-no-find-dom-node': 'off',
|
|
516
548
|
|
|
517
549
|
// Disallow usage of flushSync
|
|
@@ -524,12 +556,12 @@ export const reactRules = {
|
|
|
524
556
|
|
|
525
557
|
// Enforce that buttons have an explicit type attribute
|
|
526
558
|
// https://eslint-react.xyz/docs/rules/dom-no-missing-button-type
|
|
527
|
-
//
|
|
559
|
+
// Decision: handled by native react/button-has-type
|
|
528
560
|
'@eslint-react/dom-no-missing-button-type': 'off',
|
|
529
561
|
|
|
530
562
|
// Enforce sandbox attribute on iframe elements
|
|
531
563
|
// https://eslint-react.xyz/docs/rules/dom-no-missing-iframe-sandbox
|
|
532
|
-
//
|
|
564
|
+
// Decision: handled by native react/iframe-missing-sandbox
|
|
533
565
|
'@eslint-react/dom-no-missing-iframe-sandbox': 'off',
|
|
534
566
|
|
|
535
567
|
// Disallow usage of ReactDOM.render (use createRoot instead)
|
|
@@ -538,22 +570,22 @@ export const reactRules = {
|
|
|
538
570
|
|
|
539
571
|
// Disallow using ReactDOM.render return value
|
|
540
572
|
// https://eslint-react.xyz/docs/rules/dom-no-render-return-value
|
|
541
|
-
//
|
|
573
|
+
// Decision: handled by native react/no-render-return-value
|
|
542
574
|
'@eslint-react/dom-no-render-return-value': 'off',
|
|
543
575
|
|
|
544
576
|
// Prevent usage of javascript: URLs
|
|
545
577
|
// https://eslint-react.xyz/docs/rules/dom-no-script-url
|
|
546
|
-
//
|
|
578
|
+
// Decision: handled by native react/jsx-no-script-url
|
|
547
579
|
'@eslint-react/dom-no-script-url': 'off',
|
|
548
580
|
|
|
549
581
|
// Require style prop value be an object
|
|
550
582
|
// https://eslint-react.xyz/docs/rules/dom-no-string-style-prop
|
|
551
|
-
//
|
|
583
|
+
// Decision: handled by native react/style-prop-object
|
|
552
584
|
'@eslint-react/dom-no-string-style-prop': 'off',
|
|
553
585
|
|
|
554
586
|
// Prevent usage of unknown DOM property
|
|
555
587
|
// https://eslint-react.xyz/docs/rules/dom-no-unknown-property
|
|
556
|
-
//
|
|
588
|
+
// Decision: handled by native react/no-unknown-property
|
|
557
589
|
'@eslint-react/dom-no-unknown-property': 'off',
|
|
558
590
|
|
|
559
591
|
// Enforce safe iframe sandbox attribute values
|
|
@@ -562,7 +594,7 @@ export const reactRules = {
|
|
|
562
594
|
|
|
563
595
|
// Disallow target="_blank" without rel="noreferrer"
|
|
564
596
|
// https://eslint-react.xyz/docs/rules/dom-no-unsafe-target-blank
|
|
565
|
-
//
|
|
597
|
+
// Decision: handled by native react/jsx-no-target-blank
|
|
566
598
|
'@eslint-react/dom-no-unsafe-target-blank': 'off',
|
|
567
599
|
|
|
568
600
|
// Disallow usage of deprecated useFormState (use useActionState instead)
|
|
@@ -571,7 +603,7 @@ export const reactRules = {
|
|
|
571
603
|
|
|
572
604
|
// Prevent void DOM elements from receiving children
|
|
573
605
|
// https://eslint-react.xyz/docs/rules/dom-no-void-elements-with-children
|
|
574
|
-
//
|
|
606
|
+
// Decision: handled by native react/void-dom-elements-no-children
|
|
575
607
|
'@eslint-react/dom-no-void-elements-with-children': 'off',
|
|
576
608
|
|
|
577
609
|
// --- RSC rules ---
|