Skip to content

Commit bcd1317

Browse files
authored
Switch to @vitest/eslint-plugin (#33573)
Package has been renamed and now also provides the globals so we can replace two dependencies with one. Ref: vitest-dev/eslint-plugin-vitest#537
1 parent f58f5bb commit bcd1317

File tree

3 files changed

+75
-234
lines changed

3 files changed

+75
-234
lines changed

.eslintrc.cjs

Lines changed: 52 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
const vitestPlugin = require("@vitest/eslint-plugin");
12
const restrictedSyntax = ['WithStatement', 'ForInStatement', 'LabeledStatement', 'SequenceExpression'];
23

34
module.exports = {
@@ -37,8 +38,6 @@ module.exports = {
3738
'eslint-plugin-regexp',
3839
'eslint-plugin-sonarjs',
3940
'eslint-plugin-unicorn',
40-
'eslint-plugin-vitest',
41-
'eslint-plugin-vitest-globals',
4241
'eslint-plugin-wc',
4342
],
4443
env: {
@@ -82,59 +81,58 @@ module.exports = {
8281
},
8382
{
8483
files: ['**/*.test.*', 'web_src/js/test/setup.ts'],
85-
env: {
86-
'vitest-globals/env': true,
87-
},
84+
plugins: ["@vitest/eslint-plugin"],
85+
globals: vitestPlugin.environments.env.globals,
8886
rules: {
89-
'vitest/consistent-test-filename': [0],
90-
'vitest/consistent-test-it': [0],
91-
'vitest/expect-expect': [0],
92-
'vitest/max-expects': [0],
93-
'vitest/max-nested-describe': [0],
94-
'vitest/no-alias-methods': [0],
95-
'vitest/no-commented-out-tests': [0],
96-
'vitest/no-conditional-expect': [0],
97-
'vitest/no-conditional-in-test': [0],
98-
'vitest/no-conditional-tests': [0],
99-
'vitest/no-disabled-tests': [0],
100-
'vitest/no-done-callback': [0],
101-
'vitest/no-duplicate-hooks': [0],
102-
'vitest/no-focused-tests': [0],
103-
'vitest/no-hooks': [0],
104-
'vitest/no-identical-title': [2],
105-
'vitest/no-interpolation-in-snapshots': [0],
106-
'vitest/no-large-snapshots': [0],
107-
'vitest/no-mocks-import': [0],
108-
'vitest/no-restricted-matchers': [0],
109-
'vitest/no-restricted-vi-methods': [0],
110-
'vitest/no-standalone-expect': [0],
111-
'vitest/no-test-prefixes': [0],
112-
'vitest/no-test-return-statement': [0],
113-
'vitest/prefer-called-with': [0],
114-
'vitest/prefer-comparison-matcher': [0],
115-
'vitest/prefer-each': [0],
116-
'vitest/prefer-equality-matcher': [0],
117-
'vitest/prefer-expect-resolves': [0],
118-
'vitest/prefer-hooks-in-order': [0],
119-
'vitest/prefer-hooks-on-top': [2],
120-
'vitest/prefer-lowercase-title': [0],
121-
'vitest/prefer-mock-promise-shorthand': [0],
122-
'vitest/prefer-snapshot-hint': [0],
123-
'vitest/prefer-spy-on': [0],
124-
'vitest/prefer-strict-equal': [0],
125-
'vitest/prefer-to-be': [0],
126-
'vitest/prefer-to-be-falsy': [0],
127-
'vitest/prefer-to-be-object': [0],
128-
'vitest/prefer-to-be-truthy': [0],
129-
'vitest/prefer-to-contain': [0],
130-
'vitest/prefer-to-have-length': [0],
131-
'vitest/prefer-todo': [0],
132-
'vitest/require-hook': [0],
133-
'vitest/require-to-throw-message': [0],
134-
'vitest/require-top-level-describe': [0],
135-
'vitest/valid-describe-callback': [2],
136-
'vitest/valid-expect': [2],
137-
'vitest/valid-title': [2],
87+
'@vitest/consistent-test-filename': [0],
88+
'@vitest/consistent-test-it': [0],
89+
'@vitest/expect-expect': [0],
90+
'@vitest/max-expects': [0],
91+
'@vitest/max-nested-describe': [0],
92+
'@vitest/no-alias-methods': [0],
93+
'@vitest/no-commented-out-tests': [0],
94+
'@vitest/no-conditional-expect': [0],
95+
'@vitest/no-conditional-in-test': [0],
96+
'@vitest/no-conditional-tests': [0],
97+
'@vitest/no-disabled-tests': [0],
98+
'@vitest/no-done-callback': [0],
99+
'@vitest/no-duplicate-hooks': [0],
100+
'@vitest/no-focused-tests': [0],
101+
'@vitest/no-hooks': [0],
102+
'@vitest/no-identical-title': [2],
103+
'@vitest/no-interpolation-in-snapshots': [0],
104+
'@vitest/no-large-snapshots': [0],
105+
'@vitest/no-mocks-import': [0],
106+
'@vitest/no-restricted-matchers': [0],
107+
'@vitest/no-restricted-vi-methods': [0],
108+
'@vitest/no-standalone-expect': [0],
109+
'@vitest/no-test-prefixes': [0],
110+
'@vitest/no-test-return-statement': [0],
111+
'@vitest/prefer-called-with': [0],
112+
'@vitest/prefer-comparison-matcher': [0],
113+
'@vitest/prefer-each': [0],
114+
'@vitest/prefer-equality-matcher': [0],
115+
'@vitest/prefer-expect-resolves': [0],
116+
'@vitest/prefer-hooks-in-order': [0],
117+
'@vitest/prefer-hooks-on-top': [2],
118+
'@vitest/prefer-lowercase-title': [0],
119+
'@vitest/prefer-mock-promise-shorthand': [0],
120+
'@vitest/prefer-snapshot-hint': [0],
121+
'@vitest/prefer-spy-on': [0],
122+
'@vitest/prefer-strict-equal': [0],
123+
'@vitest/prefer-to-be': [0],
124+
'@vitest/prefer-to-be-falsy': [0],
125+
'@vitest/prefer-to-be-object': [0],
126+
'@vitest/prefer-to-be-truthy': [0],
127+
'@vitest/prefer-to-contain': [0],
128+
'@vitest/prefer-to-have-length': [0],
129+
'@vitest/prefer-todo': [0],
130+
'@vitest/require-hook': [0],
131+
'@vitest/require-to-throw-message': [0],
132+
'@vitest/require-top-level-describe': [0],
133+
'@vitest/valid-describe-callback': [2],
134+
'@vitest/valid-expect': [2],
135+
'@vitest/valid-title': [2],
138136
},
139137
},
140138
{

package-lock.json

Lines changed: 22 additions & 178 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
"@typescript-eslint/eslint-plugin": "8.21.0",
8383
"@typescript-eslint/parser": "8.21.0",
8484
"@vitejs/plugin-vue": "5.2.1",
85+
"@vitest/eslint-plugin": "1.1.30",
8586
"eslint": "8.57.0",
8687
"eslint-import-resolver-typescript": "3.7.0",
8788
"eslint-plugin-array-func": "4.0.0",
@@ -93,8 +94,6 @@
9394
"eslint-plugin-regexp": "2.7.0",
9495
"eslint-plugin-sonarjs": "3.0.1",
9596
"eslint-plugin-unicorn": "56.0.1",
96-
"eslint-plugin-vitest": "0.4.1",
97-
"eslint-plugin-vitest-globals": "1.5.0",
9897
"eslint-plugin-vue": "9.32.0",
9998
"eslint-plugin-vue-scoped-css": "2.9.0",
10099
"eslint-plugin-wc": "2.2.0",

0 commit comments

Comments
 (0)