@wistia/oxlint-config 1.0.5 → 1.1.1
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 +12 -12
- package/rules/node.mjs +10 -5
- package/rules/react.mjs +9 -0
- package/rules/unicorn.mjs +12 -0
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wistia/oxlint-config",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Wistia's Oxlint configurations",
|
|
5
|
-
"packageManager": "yarn@4.
|
|
5
|
+
"packageManager": "yarn@4.17.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"files": [
|
|
8
8
|
"configs",
|
|
@@ -51,13 +51,13 @@
|
|
|
51
51
|
"validate": "vitest run test/validate-configs.test.mjs"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
|
-
"eslint": ">= 10.
|
|
55
|
-
"oxlint": ">= 1.
|
|
54
|
+
"eslint": ">= 10.5.0",
|
|
55
|
+
"oxlint": ">= 1.70.0",
|
|
56
56
|
"oxlint-tsgolint": ">= 0.23.0"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@eslint-react/eslint-plugin": "^5.
|
|
60
|
-
"@vitest/eslint-plugin": "^1.6.
|
|
59
|
+
"@eslint-react/eslint-plugin": "^5.9.0",
|
|
60
|
+
"@vitest/eslint-plugin": "^1.6.20",
|
|
61
61
|
"confusing-browser-globals": "^1.0.11",
|
|
62
62
|
"eslint-plugin-barrel-files": "^3.0.1",
|
|
63
63
|
"eslint-plugin-import-x": "^4.16.2",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"eslint-plugin-n": "^18.1.0",
|
|
66
66
|
"eslint-plugin-no-only-tests": "^3.4.0",
|
|
67
67
|
"eslint-plugin-playwright": "^2.10.4",
|
|
68
|
-
"eslint-plugin-storybook": "^10.4.
|
|
68
|
+
"eslint-plugin-storybook": "^10.4.5",
|
|
69
69
|
"eslint-plugin-styled-components": "^0.0.0",
|
|
70
70
|
"eslint-plugin-styled-components-a11y": "^2.2.1",
|
|
71
71
|
"eslint-plugin-testing-library": "^7.16.2",
|
|
@@ -74,12 +74,12 @@
|
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@changesets/changelog-github": "^0.7.0",
|
|
76
76
|
"@changesets/cli": "^2.31.0",
|
|
77
|
-
"eslint": "^10.
|
|
78
|
-
"oxfmt": "^0.
|
|
79
|
-
"oxlint": "^1.
|
|
77
|
+
"eslint": "^10.5.0",
|
|
78
|
+
"oxfmt": "^0.55.0",
|
|
79
|
+
"oxlint": "^1.70.0",
|
|
80
80
|
"oxlint-tsgolint": "^0.23.0",
|
|
81
|
-
"storybook": "^10.4.
|
|
82
|
-
"vitest": "^4.1.
|
|
81
|
+
"storybook": "^10.4.5",
|
|
82
|
+
"vitest": "^4.1.9"
|
|
83
83
|
},
|
|
84
84
|
"engines": {
|
|
85
85
|
"node": "^20.19.0 || ^22.13.0 || >=24 || >=26"
|
package/rules/node.mjs
CHANGED
|
@@ -4,6 +4,10 @@ export const nodeRules = {
|
|
|
4
4
|
plugins: ['node'],
|
|
5
5
|
jsPlugins: [{ name: 'n', specifier: 'eslint-plugin-n' }],
|
|
6
6
|
rules: {
|
|
7
|
+
// Require return statements after callbacks
|
|
8
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/node/callback-return.html
|
|
9
|
+
'node/callback-return': 'error',
|
|
10
|
+
|
|
7
11
|
// Require error handling in callbacks
|
|
8
12
|
// https://oxc.rs/docs/guide/usage/linter/rules/node/handle-callback-err.html
|
|
9
13
|
'node/handle-callback-err': 'error',
|
|
@@ -22,13 +26,12 @@ export const nodeRules = {
|
|
|
22
26
|
|
|
23
27
|
// Disallow the use of process.env
|
|
24
28
|
// https://oxc.rs/docs/guide/usage/linter/rules/node/no-process-env.html
|
|
25
|
-
// Decision: too opinionated for general use
|
|
29
|
+
// Decision: too opinionated for general use; individual projects can enable this rule if desired
|
|
26
30
|
'node/no-process-env': 'off',
|
|
27
31
|
|
|
28
32
|
// Require require() to be called in the top-level module scope
|
|
29
33
|
// https://oxc.rs/docs/guide/usage/linter/rules/node/global-require.html
|
|
30
|
-
|
|
31
|
-
'node/global-require': 'off',
|
|
34
|
+
'node/global-require': 'error',
|
|
32
35
|
|
|
33
36
|
//eslint-plugin-n rules via jsPlugins
|
|
34
37
|
|
|
@@ -70,7 +73,8 @@ export const nodeRules = {
|
|
|
70
73
|
|
|
71
74
|
// Require return statements after callbacks
|
|
72
75
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/callback-return.md
|
|
73
|
-
|
|
76
|
+
// Decision: handled by native node/callback-return
|
|
77
|
+
'n/callback-return': 'off',
|
|
74
78
|
|
|
75
79
|
// Enforce either module.exports or exports
|
|
76
80
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/exports-style.md
|
|
@@ -78,7 +82,8 @@ export const nodeRules = {
|
|
|
78
82
|
|
|
79
83
|
// Require require() to be called in the top-level module scope
|
|
80
84
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/global-require.md
|
|
81
|
-
|
|
85
|
+
// Decision: handled by native node/global-require
|
|
86
|
+
'n/global-require': 'off',
|
|
82
87
|
|
|
83
88
|
// Disallow require calls to be mixed with regular variable declarations
|
|
84
89
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-mixed-requires.md
|
package/rules/react.mjs
CHANGED
|
@@ -272,6 +272,15 @@ export const reactRules = {
|
|
|
272
272
|
// Decision: too opinionated for general use
|
|
273
273
|
'react/state-in-constructor': 'off',
|
|
274
274
|
|
|
275
|
+
// Surface code that violates the Rules of React the compiler relies on
|
|
276
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/react/react-compiler.html
|
|
277
|
+
'react/react-compiler': 'error',
|
|
278
|
+
|
|
279
|
+
// Disallow string literals in JSX
|
|
280
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/react/jsx-no-literals.html
|
|
281
|
+
// Decision: stylistic/i18n rule, too strict for general use
|
|
282
|
+
'react/jsx-no-literals': 'off',
|
|
283
|
+
|
|
275
284
|
//rules via jsPlugins (@eslint-react/eslint-plugin)
|
|
276
285
|
|
|
277
286
|
// Validates usage of Error Boundaries instead of try/catch for child errors
|
package/rules/unicorn.mjs
CHANGED
|
@@ -95,6 +95,10 @@ export const unicornRules = {
|
|
|
95
95
|
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-array-callback-reference.html
|
|
96
96
|
'unicorn/no-array-callback-reference': 'error',
|
|
97
97
|
|
|
98
|
+
// Disallow `Array#fill()` with a reference type, which shares one reference across all slots
|
|
99
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-array-fill-with-reference-type.html
|
|
100
|
+
'unicorn/no-array-fill-with-reference-type': 'error',
|
|
101
|
+
|
|
98
102
|
// Prefer `for...of` over `Array#forEach`
|
|
99
103
|
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-array-for-each.html
|
|
100
104
|
// Decision: `Array#forEach` is a legitimate iteration pattern
|
|
@@ -395,6 +399,10 @@ export const unicornRules = {
|
|
|
395
399
|
// Decision: EventTarget vs EventEmitter is architectural; let consumers choose
|
|
396
400
|
'unicorn/prefer-event-target': 'off',
|
|
397
401
|
|
|
402
|
+
// Prefer `export ... from` over importing then exporting in two steps
|
|
403
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-export-from.html
|
|
404
|
+
'unicorn/prefer-export-from': 'error',
|
|
405
|
+
|
|
398
406
|
// Prefer `globalThis` over `window` / `self` / `global`
|
|
399
407
|
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-global-this.html
|
|
400
408
|
// Decision: we should consider enabling this in the future but it will involve a lot of refactoring
|
|
@@ -490,6 +498,10 @@ export const unicornRules = {
|
|
|
490
498
|
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-set-size.html
|
|
491
499
|
'unicorn/prefer-set-size': 'error',
|
|
492
500
|
|
|
501
|
+
// Prefer a single call over consecutive identical method calls (e.g. repeated `Array#push`)
|
|
502
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-single-call.html
|
|
503
|
+
'unicorn/prefer-single-call': 'error',
|
|
504
|
+
|
|
493
505
|
// Prefer the spread operator over `Array.from(…)` etc.
|
|
494
506
|
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-spread.html
|
|
495
507
|
'unicorn/prefer-spread': 'error',
|