@wistia/eslint-config 2.3.1 → 2.4.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/CHANGELOG.md +12 -0
- package/package.json +7 -13
- package/src/configs/node.mjs +4 -1
- package/src/configs/react.mjs +2 -13
- package/src/configs/typescript.mjs +5 -8
- package/src/rules/react.mjs +197 -476
- package/test/__snapshots__/node.mjs.snap +9 -0
- package/test/__snapshots__/react.mjs.snap +287 -525
- package/test/__snapshots__/testing-library.mjs.snap +1 -1
- package/test/__snapshots__/typescript.mjs.snap +6 -17
- package/src/rules/react-hooks.mjs +0 -72
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @wistia/eslint-config
|
|
2
2
|
|
|
3
|
+
## 2.4.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#450](https://github.com/wistia/eslint-config/pull/450) [`cb96151`](https://github.com/wistia/eslint-config/commit/cb961517b3538afe1cc27d98aa147ce3c407a15a) Thanks [@okize](https://github.com/okize)! - fix: switch import-x/resolver to import-x/resolver-next for ESLint 10 compatibility
|
|
8
|
+
|
|
9
|
+
## 2.4.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#448](https://github.com/wistia/eslint-config/pull/448) [`1ecf9aa`](https://github.com/wistia/eslint-config/commit/1ecf9aa3150c84b0ba8ca7dd40e2b3a6ffeebf31) Thanks [@okize](https://github.com/okize)! - feat: migrate from eslint-plugin-react to @eslint-react/eslint-plugin
|
|
14
|
+
|
|
3
15
|
## 2.3.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wistia/eslint-config",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.1",
|
|
4
4
|
"description": "Wistia's ESLint configurations",
|
|
5
5
|
"packageManager": "yarn@4.12.0",
|
|
6
6
|
"type": "module",
|
|
@@ -38,11 +38,12 @@
|
|
|
38
38
|
"test:export": "check-export-map"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
+
"@eslint-react/eslint-plugin": "^3.0.0",
|
|
41
42
|
"@eslint/compat": "^2.0.3",
|
|
42
43
|
"@eslint/js": "^10.0.1",
|
|
43
44
|
"@stylistic/eslint-plugin": "^5.10.0",
|
|
44
|
-
"@typescript-eslint/eslint-plugin": "^8.57.
|
|
45
|
-
"@typescript-eslint/parser": "^8.57.
|
|
45
|
+
"@typescript-eslint/eslint-plugin": "^8.57.2",
|
|
46
|
+
"@typescript-eslint/parser": "^8.57.2",
|
|
46
47
|
"@vitest/eslint-plugin": "^1.6.13",
|
|
47
48
|
"confusing-browser-globals": "^1.0.11",
|
|
48
49
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
@@ -57,14 +58,11 @@
|
|
|
57
58
|
"eslint-plugin-playwright": "^2.10.1",
|
|
58
59
|
"eslint-plugin-prettier": "^5.5.5",
|
|
59
60
|
"eslint-plugin-promise": "^7.2.1",
|
|
60
|
-
"eslint-plugin-react": "^7.37.5",
|
|
61
|
-
"eslint-plugin-react-compiler": "^19.1.0-rc.2",
|
|
62
|
-
"eslint-plugin-react-hooks": "^7.0.1",
|
|
63
61
|
"eslint-plugin-react-hooks-ssr": "^0.1.5",
|
|
64
62
|
"eslint-plugin-ssr-friendly": "^1.3.0",
|
|
65
63
|
"eslint-plugin-storybook": "^10.3.3",
|
|
66
64
|
"eslint-plugin-styled-components-a11y": "^2.2.1",
|
|
67
|
-
"eslint-plugin-testing-library": "^7.16.
|
|
65
|
+
"eslint-plugin-testing-library": "^7.16.2",
|
|
68
66
|
"globals": "^17.4.0",
|
|
69
67
|
"globals-vitest": "^4.1.0"
|
|
70
68
|
},
|
|
@@ -79,20 +77,16 @@
|
|
|
79
77
|
"husky": "^9.1.7",
|
|
80
78
|
"prettier": "^3.8.1",
|
|
81
79
|
"storybook": "^10.3.3",
|
|
82
|
-
"typescript": "^
|
|
80
|
+
"typescript": "^6.0.2",
|
|
83
81
|
"vitest": "^4.1.1"
|
|
84
82
|
},
|
|
85
83
|
"peerDependencies": {
|
|
86
84
|
"eslint": ">= 10",
|
|
87
|
-
"storybook": ">= 9"
|
|
88
|
-
"typescript": ">= 5"
|
|
85
|
+
"storybook": ">= 9"
|
|
89
86
|
},
|
|
90
87
|
"peerDependenciesMeta": {
|
|
91
88
|
"storybook": {
|
|
92
89
|
"optional": true
|
|
93
|
-
},
|
|
94
|
-
"typescript": {
|
|
95
|
-
"optional": true
|
|
96
90
|
}
|
|
97
91
|
},
|
|
98
92
|
"keywords": [
|
package/src/configs/node.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import globals from 'globals';
|
|
2
2
|
import nodePlugin from 'eslint-plugin-n';
|
|
3
|
-
import { importX as importPlugin } from 'eslint-plugin-import-x';
|
|
3
|
+
import { importX as importPlugin, createNodeResolver } from 'eslint-plugin-import-x';
|
|
4
4
|
import nodeRules from '../rules/node.mjs';
|
|
5
5
|
|
|
6
6
|
export default [
|
|
@@ -14,6 +14,9 @@ export default [
|
|
|
14
14
|
n: nodePlugin,
|
|
15
15
|
'import-x': importPlugin,
|
|
16
16
|
},
|
|
17
|
+
settings: {
|
|
18
|
+
'import-x/resolver-next': [createNodeResolver()],
|
|
19
|
+
},
|
|
17
20
|
rules: {
|
|
18
21
|
...nodeRules,
|
|
19
22
|
},
|
package/src/configs/react.mjs
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import globals from 'globals';
|
|
2
|
-
import
|
|
2
|
+
import eslintReact from '@eslint-react/eslint-plugin';
|
|
3
3
|
import jsxA11yPlugin from 'eslint-plugin-jsx-a11y';
|
|
4
|
-
import reactHooksPlugin from 'eslint-plugin-react-hooks';
|
|
5
|
-
import reactCompilerPlugin from 'eslint-plugin-react-compiler';
|
|
6
4
|
import reactRules from '../rules/react.mjs';
|
|
7
5
|
import reactA11yRules from '../rules/react-a11y.mjs';
|
|
8
|
-
import reactHooksRules from '../rules/react-hooks.mjs';
|
|
9
6
|
|
|
10
7
|
export default [
|
|
11
8
|
{
|
|
@@ -19,21 +16,13 @@ export default [
|
|
|
19
16
|
...globals.browser,
|
|
20
17
|
},
|
|
21
18
|
},
|
|
22
|
-
settings: {
|
|
23
|
-
react: {
|
|
24
|
-
version: 'detect',
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
19
|
plugins: {
|
|
28
|
-
|
|
20
|
+
...eslintReact.configs.all.plugins,
|
|
29
21
|
'jsx-a11y': jsxA11yPlugin,
|
|
30
|
-
'react-hooks': reactHooksPlugin,
|
|
31
|
-
'react-compiler': reactCompilerPlugin,
|
|
32
22
|
},
|
|
33
23
|
rules: {
|
|
34
24
|
...reactRules,
|
|
35
25
|
...reactA11yRules,
|
|
36
|
-
...reactHooksRules,
|
|
37
26
|
},
|
|
38
27
|
},
|
|
39
28
|
];
|
|
@@ -5,6 +5,7 @@ import { fixupPluginRules } from '@eslint/compat';
|
|
|
5
5
|
import stylisticPlugin from '@stylistic/eslint-plugin';
|
|
6
6
|
import filenamesPlugin from 'eslint-plugin-filenames';
|
|
7
7
|
import { importX as importPlugin } from 'eslint-plugin-import-x';
|
|
8
|
+
import { createTypeScriptImportResolver } from 'eslint-import-resolver-typescript';
|
|
8
9
|
import barrelFilesPlugin from 'eslint-plugin-barrel-files';
|
|
9
10
|
import prettierPlugin from 'eslint-plugin-prettier';
|
|
10
11
|
import promisePlugin from 'eslint-plugin-promise';
|
|
@@ -53,19 +54,15 @@ export default [
|
|
|
53
54
|
'@typescript-eslint/parser': ['.ts', '.cts', '.mts', '.tsx'],
|
|
54
55
|
},
|
|
55
56
|
|
|
56
|
-
'import-x/resolver':
|
|
57
|
-
|
|
58
|
-
node: {
|
|
59
|
-
extensions: ['.ts', '.cts', '.mts', '.tsx', '.js', '.jsx', '.mjs', '.cjs'],
|
|
60
|
-
},
|
|
61
|
-
|
|
57
|
+
'import-x/resolver-next': [
|
|
58
|
+
createTypeScriptImportResolver({
|
|
62
59
|
// always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/lodash`
|
|
63
60
|
alwaysTryTypes: true,
|
|
64
61
|
|
|
65
62
|
// use <root>/path/to/folder/tsconfig.json
|
|
66
63
|
project: '<root>/tsconfig.json',
|
|
67
|
-
},
|
|
68
|
-
|
|
64
|
+
}),
|
|
65
|
+
],
|
|
69
66
|
},
|
|
70
67
|
rules: {
|
|
71
68
|
...baseRules,
|