@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/import.mjs
CHANGED
|
@@ -93,55 +93,70 @@ export const importRules = {
|
|
|
93
93
|
|
|
94
94
|
// Enforce consistent type specifier style (inline vs top-level)
|
|
95
95
|
// https://oxc.rs/docs/guide/usage/linter/rules/import/consistent-type-specifier-style.html
|
|
96
|
-
'import/consistent-type-specifier-style': '
|
|
96
|
+
'import/consistent-type-specifier-style': ['error', 'prefer-top-level'],
|
|
97
97
|
|
|
98
98
|
// Disallow invalid exports, e.g. multiple defaults
|
|
99
99
|
// https://oxc.rs/docs/guide/usage/linter/rules/import/export.html
|
|
100
|
-
|
|
100
|
+
// Decision: too opinionated for general use
|
|
101
|
+
'import/export': 'error',
|
|
101
102
|
|
|
102
103
|
// Require exports to be placed at the end of the file
|
|
103
104
|
// https://oxc.rs/docs/guide/usage/linter/rules/import/exports-last.html
|
|
105
|
+
// Decision: too opinionated for general use
|
|
104
106
|
'import/exports-last': 'off',
|
|
105
107
|
|
|
106
108
|
// Prefer named exports to be grouped together in a single export declaration
|
|
107
109
|
// https://oxc.rs/docs/guide/usage/linter/rules/import/group-exports.html
|
|
110
|
+
// Decision: too opinionated for general use
|
|
108
111
|
'import/group-exports': 'off',
|
|
109
112
|
|
|
110
113
|
// Enforce a maximum number of dependencies per module
|
|
111
114
|
// https://oxc.rs/docs/guide/usage/linter/rules/import/max-dependencies.html
|
|
115
|
+
// Decision: too opinionated for general use
|
|
112
116
|
'import/max-dependencies': 'off',
|
|
113
117
|
|
|
118
|
+
// Require a newline after the last import/require in a group
|
|
119
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/import/newline-after-import.html
|
|
120
|
+
'import/newline-after-import': 'error',
|
|
121
|
+
|
|
114
122
|
// Ensure named imports coupled with named exports
|
|
115
123
|
// https://oxc.rs/docs/guide/usage/linter/rules/import/named.html
|
|
124
|
+
// Decision: handled by TypeScript
|
|
116
125
|
'import/named': 'off',
|
|
117
126
|
|
|
118
127
|
// Forbid named exports
|
|
119
128
|
// https://oxc.rs/docs/guide/usage/linter/rules/import/no-named-export.html
|
|
129
|
+
// Decision: conflicts with no-default-export which is enabled
|
|
120
130
|
'import/no-named-export': 'off',
|
|
121
131
|
|
|
122
132
|
// Disallow namespace (a.k.a. "wildcard" *) imports
|
|
123
133
|
// https://oxc.rs/docs/guide/usage/linter/rules/import/no-namespace.html
|
|
134
|
+
// Decision: too opinionated for general use
|
|
124
135
|
'import/no-namespace': 'off',
|
|
125
136
|
|
|
126
137
|
// Disallow Node.js builtin modules
|
|
127
138
|
// https://oxc.rs/docs/guide/usage/linter/rules/import/no-nodejs-modules.html
|
|
139
|
+
// Decision: not applicable to this project
|
|
128
140
|
'import/no-nodejs-modules': 'off',
|
|
129
141
|
|
|
130
142
|
// Forbid importing modules from parent directories
|
|
131
143
|
// https://oxc.rs/docs/guide/usage/linter/rules/import/no-relative-parent-imports.html
|
|
144
|
+
// Decision: too opinionated for general use
|
|
132
145
|
'import/no-relative-parent-imports': 'off',
|
|
133
146
|
|
|
134
147
|
// Forbid unassigned imports (side-effect imports)
|
|
135
148
|
// https://oxc.rs/docs/guide/usage/linter/rules/import/no-unassigned-import.html
|
|
149
|
+
// Decision: too opinionated for general use
|
|
136
150
|
'import/no-unassigned-import': 'off',
|
|
137
151
|
|
|
138
152
|
// Report potentially ambiguous parse goal
|
|
139
153
|
// https://oxc.rs/docs/guide/usage/linter/rules/import/unambiguous.html
|
|
154
|
+
// Decision: too opinionated for general use
|
|
140
155
|
'import/unambiguous': 'off',
|
|
141
156
|
|
|
142
157
|
// Require modules with a single export to use a default export
|
|
143
158
|
// https://oxc.rs/docs/guide/usage/linter/rules/import/prefer-default-export.html
|
|
144
|
-
//
|
|
159
|
+
// Decision: conflicts with no-default-export, which is enabled
|
|
145
160
|
'import/prefer-default-export': 'off',
|
|
146
161
|
|
|
147
162
|
//rules via jsPlugins (eslint-plugin-import-x)
|
|
@@ -151,6 +166,7 @@ export const importRules = {
|
|
|
151
166
|
// NOTE: disabled — requires eslint-import-resolver-typescript to resolve TS paths.
|
|
152
167
|
// oxlint's jsPlugin runner does not pass ESLint settings to plugins, so the resolver
|
|
153
168
|
// config never reaches the plugin.
|
|
169
|
+
// Decision: requires resolver configuration unavailable in oxlint jsPlugin runtime
|
|
154
170
|
'import-x-js/no-unresolved': 'off',
|
|
155
171
|
|
|
156
172
|
// Disallow invalid exports, e.g. multiple defaults
|
|
@@ -163,19 +179,17 @@ export const importRules = {
|
|
|
163
179
|
'error',
|
|
164
180
|
{
|
|
165
181
|
devDependencies: [
|
|
166
|
-
'**/*{.,_}{test,vitest,spec}.{js,jsx,ts,tsx}',
|
|
182
|
+
'**/*{.,_}{test,vitest,spec,stories}.{js,jsx,ts,tsx}',
|
|
183
|
+
'**/oxfmt.config.*',
|
|
184
|
+
'**/.oxfmtrc.json*',
|
|
167
185
|
'**/vite.config.{ts,js,cjs,mjs,mts}',
|
|
168
186
|
'**/vitest.config.{ts,js,cjs,mjs,mts}',
|
|
169
|
-
'**/jest.config.{js,cjs,mjs,mts}',
|
|
170
|
-
'**/jest.setup.{js,cjs,mjs,mts}',
|
|
171
187
|
'**/eslint.config.{js,cjs,mjs,mts}',
|
|
172
188
|
'**/.eslintrc.{js,cjs}',
|
|
173
189
|
'**/.stylelintrc.{cjs,js,json,yaml,yml}',
|
|
174
190
|
'**/stylelint.config.{cjs,mjs,mts,js}',
|
|
175
191
|
'**/esbuild.config.{js,cjs,mjs,mts}',
|
|
176
192
|
'**/tsup.config.{js,cjs,mjs,mts}',
|
|
177
|
-
'**/webpack.config.{js,cjs,mjs,mts}',
|
|
178
|
-
'**/webpack.config.*.{js,cjs,mjs,mts}',
|
|
179
193
|
'**/rollup.config.{js,cjs,mjs,mts}',
|
|
180
194
|
'**/rollup.config.*.{js,cjs,mjs,mts}',
|
|
181
195
|
],
|
|
@@ -186,11 +200,13 @@ export const importRules = {
|
|
|
186
200
|
// Reports if a default export is renamed during import
|
|
187
201
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-rename-default.md
|
|
188
202
|
// NOTE: disabled — parser errors on TS modules without eslint-import-resolver-typescript.
|
|
203
|
+
// Decision: requires resolver configuration unavailable in oxlint jsPlugin runtime
|
|
189
204
|
'import-x-js/no-rename-default': 'off',
|
|
190
205
|
|
|
191
206
|
// Ensure consistent use of file extension within the import path
|
|
192
207
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/extensions.md
|
|
193
208
|
// NOTE: disabled — cannot determine file existence without eslint-import-resolver-typescript.
|
|
209
|
+
// Decision: requires resolver configuration unavailable in oxlint jsPlugin runtime
|
|
194
210
|
'import-x-js/extensions': 'off',
|
|
195
211
|
|
|
196
212
|
// Ensure absolute imports are above relative imports
|
|
@@ -205,7 +221,8 @@ export const importRules = {
|
|
|
205
221
|
|
|
206
222
|
// Require a newline after the last import/require in a group
|
|
207
223
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/newline-after-import.md
|
|
208
|
-
|
|
224
|
+
// Decision: handled by native import/newline-after-import
|
|
225
|
+
'import-x-js/newline-after-import': 'off',
|
|
209
226
|
|
|
210
227
|
// Ensures that there are no useless path segments
|
|
211
228
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-useless-path-segments.md
|
|
@@ -221,187 +238,187 @@ export const importRules = {
|
|
|
221
238
|
|
|
222
239
|
// Ensure named imports coupled with named exports
|
|
223
240
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/named.md
|
|
224
|
-
//
|
|
241
|
+
// Decision: requires resolver configuration unavailable in oxlint jsPlugin runtime
|
|
225
242
|
'import-x-js/named': 'off',
|
|
226
243
|
|
|
227
244
|
// Ensure default import coupled with default export
|
|
228
245
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/default.md
|
|
229
|
-
//
|
|
246
|
+
// Decision: handled by native import/default
|
|
230
247
|
'import-x-js/default': 'off',
|
|
231
248
|
|
|
232
249
|
// Ensure imported namespaces contain dereferenced properties as they are dereferenced
|
|
233
250
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/namespace.md
|
|
234
|
-
//
|
|
251
|
+
// Decision: handled by native import/namespace
|
|
235
252
|
'import-x-js/namespace': 'off',
|
|
236
253
|
|
|
237
254
|
// Disallow namespace (a.k.a. "wildcard" *) imports
|
|
238
255
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-namespace.md
|
|
239
|
-
//
|
|
256
|
+
// Decision: too restrictive for general use
|
|
240
257
|
'import-x-js/no-namespace': 'off',
|
|
241
258
|
|
|
242
259
|
// Forbid mutable exports
|
|
243
260
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-mutable-exports.md
|
|
244
|
-
//
|
|
261
|
+
// Decision: handled by native import/no-mutable-exports
|
|
245
262
|
'import-x-js/no-mutable-exports': 'off',
|
|
246
263
|
|
|
247
264
|
// Restrict which files can be imported in a given folder
|
|
248
265
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-restricted-paths.md
|
|
249
|
-
//
|
|
266
|
+
// Decision: project-specific, not configured by default
|
|
250
267
|
'import-x-js/no-restricted-paths': 'off',
|
|
251
268
|
|
|
252
269
|
// Prevent importing the submodules of other modules
|
|
253
270
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-internal-modules.md
|
|
254
|
-
//
|
|
271
|
+
// Decision: project-specific, not configured by default
|
|
255
272
|
'import-x-js/no-internal-modules': 'off',
|
|
256
273
|
|
|
257
274
|
// Prefer named exports to be grouped together in a single export declaration
|
|
258
275
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/group-exports.md
|
|
259
|
-
//
|
|
276
|
+
// Decision: too restrictive for general use
|
|
260
277
|
'import-x-js/group-exports': 'off',
|
|
261
278
|
|
|
262
279
|
// Forbid importing modules from parent directories
|
|
263
280
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-relative-parent-imports.md
|
|
264
|
-
//
|
|
281
|
+
// Decision: too restrictive for general use
|
|
265
282
|
'import-x-js/no-relative-parent-imports': 'off',
|
|
266
283
|
|
|
267
284
|
// Enforce consistent type import style
|
|
268
285
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/consistent-type-specifier-style.md
|
|
269
|
-
//
|
|
286
|
+
// Decision: handled by TypeScript config
|
|
270
287
|
'import-x-js/consistent-type-specifier-style': 'off',
|
|
271
288
|
|
|
272
289
|
// Forbid a module from importing itself
|
|
273
290
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-self-import.md
|
|
274
|
-
//
|
|
291
|
+
// Decision: handled by native import/no-self-import
|
|
275
292
|
'import-x-js/no-self-import': 'off',
|
|
276
293
|
|
|
277
294
|
// Forbid cyclical dependencies between modules
|
|
278
295
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-cycle.md
|
|
279
|
-
//
|
|
296
|
+
// Decision: handled by native import/no-cycle
|
|
280
297
|
'import-x-js/no-cycle': 'off',
|
|
281
298
|
|
|
282
299
|
// Prevent importing the default as if it were named
|
|
283
300
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-named-default.md
|
|
284
|
-
//
|
|
301
|
+
// Decision: handled by native import/no-named-default
|
|
285
302
|
'import-x-js/no-named-default': 'off',
|
|
286
303
|
|
|
287
304
|
// Do not allow a default import name to match a named export
|
|
288
305
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-named-as-default.md
|
|
289
|
-
//
|
|
306
|
+
// Decision: handled by native import/no-named-as-default
|
|
290
307
|
'import-x-js/no-named-as-default': 'off',
|
|
291
308
|
|
|
292
309
|
// Warn on accessing default export property names that are also named exports
|
|
293
310
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-named-as-default-member.md
|
|
294
|
-
//
|
|
311
|
+
// Decision: handled by native import/no-named-as-default-member
|
|
295
312
|
'import-x-js/no-named-as-default-member': 'off',
|
|
296
313
|
|
|
297
314
|
// Reports if a module's default export is unnamed
|
|
298
315
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-anonymous-default-export.md
|
|
299
|
-
//
|
|
316
|
+
// Decision: handled by native import/no-anonymous-default-export
|
|
300
317
|
'import-x-js/no-anonymous-default-export': 'off',
|
|
301
318
|
|
|
302
319
|
// Reports modules without any exports, or with unused exports
|
|
303
320
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-unused-modules.md
|
|
304
|
-
//
|
|
321
|
+
// Decision: requires resolver configuration unavailable in oxlint jsPlugin runtime
|
|
305
322
|
'import-x-js/no-unused-modules': 'off',
|
|
306
323
|
|
|
307
324
|
// Disallow require()
|
|
308
325
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-commonjs.md
|
|
309
|
-
//
|
|
326
|
+
// Decision: handled by native import/no-commonjs
|
|
310
327
|
'import-x-js/no-commonjs': 'off',
|
|
311
328
|
|
|
312
329
|
// Disallow AMD require/define
|
|
313
330
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-amd.md
|
|
314
|
-
//
|
|
331
|
+
// Decision: handled by native import/no-amd
|
|
315
332
|
'import-x-js/no-amd': 'off',
|
|
316
333
|
|
|
317
334
|
// Disallow duplicate imports
|
|
318
335
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-duplicates.md
|
|
319
|
-
//
|
|
336
|
+
// Decision: handled by native import/no-duplicates
|
|
320
337
|
'import-x-js/no-duplicates': 'off',
|
|
321
338
|
|
|
322
339
|
// Disallow non-import statements appearing before import statements
|
|
323
340
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/first.md
|
|
324
|
-
//
|
|
341
|
+
// Decision: handled by native import/first
|
|
325
342
|
'import-x-js/first': 'off',
|
|
326
343
|
|
|
327
344
|
// Enforce a maximum number of dependencies per module
|
|
328
345
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/max-dependencies.md
|
|
329
|
-
//
|
|
346
|
+
// Decision: too restrictive for general use
|
|
330
347
|
'import-x-js/max-dependencies': 'off',
|
|
331
348
|
|
|
332
349
|
// Forbid import of modules using absolute paths
|
|
333
350
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-absolute-path.md
|
|
334
|
-
//
|
|
351
|
+
// Decision: handled by native import/no-absolute-path
|
|
335
352
|
'import-x-js/no-absolute-path': 'off',
|
|
336
353
|
|
|
337
354
|
// Disallow Node.js builtin modules
|
|
338
355
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-nodejs-modules.md
|
|
339
|
-
//
|
|
356
|
+
// Decision: too restrictive for general use
|
|
340
357
|
'import-x-js/no-nodejs-modules': 'off',
|
|
341
358
|
|
|
342
359
|
// Forbid Webpack loader syntax in imports
|
|
343
360
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-webpack-loader-syntax.md
|
|
344
|
-
//
|
|
361
|
+
// Decision: handled by native import/no-webpack-loader-syntax
|
|
345
362
|
'import-x-js/no-webpack-loader-syntax': 'off',
|
|
346
363
|
|
|
347
364
|
// Require modules with a single export to use a default export
|
|
348
365
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/prefer-default-export.md
|
|
349
|
-
//
|
|
366
|
+
// Decision: handled by native import/prefer-default-export
|
|
350
367
|
'import-x-js/prefer-default-export': 'off',
|
|
351
368
|
|
|
352
369
|
// Prefer namespace (wildcard *) imports
|
|
353
370
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/prefer-namespace-import.md
|
|
354
|
-
//
|
|
371
|
+
// Decision: too restrictive for general use
|
|
355
372
|
'import-x-js/prefer-namespace-import': 'off',
|
|
356
373
|
|
|
357
374
|
// Forbid default exports
|
|
358
375
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-default-export.md
|
|
359
|
-
//
|
|
376
|
+
// Decision: handled by native import/no-default-export
|
|
360
377
|
'import-x-js/no-default-export': 'off',
|
|
361
378
|
|
|
362
379
|
// Forbid named exports
|
|
363
380
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-named-export.md
|
|
364
|
-
//
|
|
381
|
+
// Decision: conflicts with no-default-export which is enabled
|
|
365
382
|
'import-x-js/no-named-export': 'off',
|
|
366
383
|
|
|
367
384
|
// Forbid require() calls with expressions
|
|
368
385
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-dynamic-require.md
|
|
369
|
-
//
|
|
386
|
+
// Decision: handled by native import/no-dynamic-require
|
|
370
387
|
'import-x-js/no-dynamic-require': 'off',
|
|
371
388
|
|
|
372
389
|
// Report potentially ambiguous parse goal
|
|
373
390
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/unambiguous.md
|
|
374
|
-
//
|
|
391
|
+
// Decision: not useful with ESM
|
|
375
392
|
'import-x-js/unambiguous': 'off',
|
|
376
393
|
|
|
377
394
|
// Forbid unassigned imports (side-effect imports)
|
|
378
395
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-unassigned-import.md
|
|
379
|
-
//
|
|
396
|
+
// Decision: too restrictive — CSS imports, polyfills, etc. are valid
|
|
380
397
|
'import-x-js/no-unassigned-import': 'off',
|
|
381
398
|
|
|
382
399
|
// Enforce a leading comment with the webpackChunkName for dynamic imports
|
|
383
400
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/dynamic-import-chunkname.md
|
|
384
|
-
//
|
|
401
|
+
// Decision: webpack-specific, not applicable
|
|
385
402
|
'import-x-js/dynamic-import-chunkname': 'off',
|
|
386
403
|
|
|
387
404
|
// Forbid empty named import blocks
|
|
388
405
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-empty-named-blocks.md
|
|
389
|
-
//
|
|
406
|
+
// Decision: handled by native import/no-empty-named-blocks
|
|
390
407
|
'import-x-js/no-empty-named-blocks': 'off',
|
|
391
408
|
|
|
392
409
|
// Require exports to be placed at the end of the file
|
|
393
410
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/exports-last.md
|
|
394
|
-
//
|
|
411
|
+
// Decision: too restrictive for general use
|
|
395
412
|
'import-x-js/exports-last': 'off',
|
|
396
413
|
|
|
397
414
|
// Report imported names marked as @deprecated
|
|
398
415
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-deprecated.md
|
|
399
|
-
//
|
|
416
|
+
// Decision: requires resolver configuration unavailable in oxlint jsPlugin runtime
|
|
400
417
|
'import-x-js/no-deprecated': 'off',
|
|
401
418
|
|
|
402
419
|
// Disallow non-import statements appearing before import statements (alias)
|
|
403
420
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/imports-first.md
|
|
404
|
-
//
|
|
421
|
+
// Decision: deprecated alias for first, handled by native import/first
|
|
405
422
|
'import-x-js/imports-first': 'off',
|
|
406
423
|
},
|
|
407
424
|
};
|
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,8 +50,33 @@ 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
|
|
|
56
|
+
// Enforce that a control (an interactive element) has a text label
|
|
57
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/jsx-a11y/control-has-associated-label.html
|
|
58
|
+
'jsx_a11y/control-has-associated-label': [
|
|
59
|
+
'error',
|
|
60
|
+
{
|
|
61
|
+
labelAttributes: ['label'],
|
|
62
|
+
controlComponents: [],
|
|
63
|
+
ignoreElements: ['audio', 'canvas', 'embed', 'input', 'textarea', 'tr', 'video'],
|
|
64
|
+
ignoreRoles: [
|
|
65
|
+
'grid',
|
|
66
|
+
'listbox',
|
|
67
|
+
'menu',
|
|
68
|
+
'menubar',
|
|
69
|
+
'radiogroup',
|
|
70
|
+
'row',
|
|
71
|
+
'tablist',
|
|
72
|
+
'toolbar',
|
|
73
|
+
'tree',
|
|
74
|
+
'treegrid',
|
|
75
|
+
],
|
|
76
|
+
depth: 5,
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
|
|
55
80
|
// Enforce a clickable non-interactive element has at least one keyboard event listener
|
|
56
81
|
// https://oxc.rs/docs/guide/usage/linter/rules/jsx-a11y/click-events-have-key-events.html
|
|
57
82
|
'jsx_a11y/click-events-have-key-events': 'error',
|
|
@@ -117,10 +142,6 @@ export const reactA11yRules = {
|
|
|
117
142
|
// https://oxc.rs/docs/guide/usage/linter/rules/jsx_a11y/interactive-supports-focus.html
|
|
118
143
|
'jsx_a11y/interactive-supports-focus': 'error',
|
|
119
144
|
|
|
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
145
|
// Ensure interactive elements are not assigned non-interactive roles
|
|
125
146
|
// https://oxc.rs/docs/guide/usage/linter/rules/jsx-a11y/no-noninteractive-tabindex.html
|
|
126
147
|
'jsx_a11y/no-noninteractive-tabindex': [
|
|
@@ -131,6 +152,33 @@ export const reactA11yRules = {
|
|
|
131
152
|
},
|
|
132
153
|
],
|
|
133
154
|
|
|
155
|
+
// Ensure interactive elements are not assigned non-interactive roles
|
|
156
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/jsx-a11y/no-interactive-element-to-noninteractive-role.html
|
|
157
|
+
'jsx_a11y/no-interactive-element-to-noninteractive-role': [
|
|
158
|
+
'error',
|
|
159
|
+
{ tr: ['none', 'presentation'] },
|
|
160
|
+
],
|
|
161
|
+
|
|
162
|
+
// Enforce that non-interactive elements do not have interaction handlers
|
|
163
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/jsx-a11y/no-noninteractive-element-interactions.html
|
|
164
|
+
'jsx_a11y/no-noninteractive-element-interactions': [
|
|
165
|
+
'error',
|
|
166
|
+
{ handlers: ['onClick', 'onMouseDown', 'onMouseUp', 'onKeyPress', 'onKeyDown', 'onKeyUp'] },
|
|
167
|
+
],
|
|
168
|
+
|
|
169
|
+
// Enforce that non-interactive elements are not assigned interactive roles
|
|
170
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/jsx-a11y/no-noninteractive-element-to-interactive-role.html
|
|
171
|
+
'jsx_a11y/no-noninteractive-element-to-interactive-role': [
|
|
172
|
+
'error',
|
|
173
|
+
{
|
|
174
|
+
ul: ['listbox', 'menu', 'menubar', 'radiogroup', 'tablist', 'tree', 'treegrid'],
|
|
175
|
+
ol: ['listbox', 'menu', 'menubar', 'radiogroup', 'tablist', 'tree', 'treegrid'],
|
|
176
|
+
li: ['menuitem', 'option', 'row', 'tab', 'treeitem'],
|
|
177
|
+
table: ['grid'],
|
|
178
|
+
td: ['gridcell'],
|
|
179
|
+
},
|
|
180
|
+
],
|
|
181
|
+
|
|
134
182
|
// Enforce explicit role is not redundant with implicit role of the element
|
|
135
183
|
// https://oxc.rs/docs/guide/usage/linter/rules/jsx-a11y/no-redundant-roles.html
|
|
136
184
|
'jsx_a11y/no-redundant-roles': 'error',
|
|
@@ -153,7 +201,7 @@ export const reactA11yRules = {
|
|
|
153
201
|
|
|
154
202
|
// Prefer semantic HTML elements over role attributes
|
|
155
203
|
// https://oxc.rs/docs/guide/usage/linter/rules/jsx-a11y/prefer-tag-over-role.html
|
|
156
|
-
//
|
|
204
|
+
// Decision: left to implementer
|
|
157
205
|
'jsx_a11y/prefer-tag-over-role': 'off',
|
|
158
206
|
},
|
|
159
207
|
};
|