@wistia/eslint-config 2.4.0 → 2.4.2
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 +4 -4
- package/src/configs/node.mjs +4 -1
- package/src/configs/typescript.mjs +5 -8
- package/src/rules/vitest.mjs +2 -1
- package/test/__snapshots__/node.mjs.snap +9 -0
- package/test/__snapshots__/testing-library.mjs.snap +1 -1
- package/test/__snapshots__/typescript.mjs.snap +6 -17
- package/test/__snapshots__/vitest.mjs.snap +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @wistia/eslint-config
|
|
2
2
|
|
|
3
|
+
## 2.4.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#452](https://github.com/wistia/eslint-config/pull/452) [`a7fba62`](https://github.com/wistia/eslint-config/commit/a7fba62c91213c3bd03806b7b5bd4aa8a1b885a0) Thanks [@okize](https://github.com/okize)! - fix: disable `vitest/prefer-called-once` rule since it conflicts
|
|
8
|
+
|
|
9
|
+
## 2.4.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#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
|
|
14
|
+
|
|
3
15
|
## 2.4.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wistia/eslint-config",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.2",
|
|
4
4
|
"description": "Wistia's ESLint configurations",
|
|
5
5
|
"packageManager": "yarn@4.12.0",
|
|
6
6
|
"type": "module",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"@eslint/compat": "^2.0.3",
|
|
43
43
|
"@eslint/js": "^10.0.1",
|
|
44
44
|
"@stylistic/eslint-plugin": "^5.10.0",
|
|
45
|
-
"@typescript-eslint/eslint-plugin": "^8.57.
|
|
46
|
-
"@typescript-eslint/parser": "^8.57.
|
|
45
|
+
"@typescript-eslint/eslint-plugin": "^8.57.2",
|
|
46
|
+
"@typescript-eslint/parser": "^8.57.2",
|
|
47
47
|
"@vitest/eslint-plugin": "^1.6.13",
|
|
48
48
|
"confusing-browser-globals": "^1.0.11",
|
|
49
49
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"eslint-plugin-ssr-friendly": "^1.3.0",
|
|
63
63
|
"eslint-plugin-storybook": "^10.3.3",
|
|
64
64
|
"eslint-plugin-styled-components-a11y": "^2.2.1",
|
|
65
|
-
"eslint-plugin-testing-library": "^7.16.
|
|
65
|
+
"eslint-plugin-testing-library": "^7.16.2",
|
|
66
66
|
"globals": "^17.4.0",
|
|
67
67
|
"globals-vitest": "^4.1.0"
|
|
68
68
|
},
|
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
|
},
|
|
@@ -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,
|
package/src/rules/vitest.mjs
CHANGED
|
@@ -172,7 +172,8 @@ export default {
|
|
|
172
172
|
|
|
173
173
|
// Prefer toHaveBeenCalledOnce() over toHaveBeenCalledTimes(1)
|
|
174
174
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-called-once.md
|
|
175
|
-
|
|
175
|
+
// decision: this conflicts with `prefer-called-times` rule, which is enabled
|
|
176
|
+
'vitest/prefer-called-once': 'off',
|
|
176
177
|
|
|
177
178
|
// Prefer toHaveBeenCalledTimes over multiple assertions
|
|
178
179
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-called-times.md
|
|
@@ -2690,23 +2690,12 @@
|
|
|
2690
2690
|
".tsx",
|
|
2691
2691
|
],
|
|
2692
2692
|
},
|
|
2693
|
-
"import-x/resolver":
|
|
2694
|
-
|
|
2695
|
-
"
|
|
2696
|
-
"
|
|
2697
|
-
|
|
2698
|
-
".ts",
|
|
2699
|
-
".cts",
|
|
2700
|
-
".mts",
|
|
2701
|
-
".tsx",
|
|
2702
|
-
".js",
|
|
2703
|
-
".jsx",
|
|
2704
|
-
".mjs",
|
|
2705
|
-
".cjs",
|
|
2706
|
-
],
|
|
2707
|
-
},
|
|
2708
|
-
"project": "<root>/tsconfig.json",
|
|
2693
|
+
"import-x/resolver-next": [
|
|
2694
|
+
{
|
|
2695
|
+
"interfaceVersion": 3,
|
|
2696
|
+
"name": "eslint-import-resolver-typescript",
|
|
2697
|
+
"resolve": "<function>",
|
|
2709
2698
|
},
|
|
2710
|
-
|
|
2699
|
+
],
|
|
2711
2700
|
},
|
|
2712
2701
|
}
|