Skip to content

Commit ee91997

Browse files
committed
switch to @vitest/eslint-plugin
1 parent a96cbc3 commit ee91997

File tree

4 files changed

+76
-271
lines changed

4 files changed

+76
-271
lines changed

eslintrc.js

Lines changed: 52 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import {restrictedGlobals, restrictedWorkerGlobals} from "./globals.js";
22
import {defineConfig} from "eslint-define-config";
3+
import globals from "globals";
34

45
export default defineConfig({
56
"root": true,
@@ -19,8 +20,6 @@ export default defineConfig({
1920
"eslint-plugin-sonarjs",
2021
"eslint-plugin-tsdoc",
2122
"eslint-plugin-unicorn",
22-
"eslint-plugin-vitest",
23-
"eslint-plugin-vitest-globals",
2423
],
2524
"parser": "@typescript-eslint/parser",
2625
"parserOptions": {
@@ -86,60 +85,59 @@ export default defineConfig({
8685
"vitest.setup.*",
8786
"integration/**",
8887
],
89-
"env": {
90-
"vitest-globals/env": true,
91-
},
88+
"plugins": ["@vitest/eslint-plugin"],
89+
"globals": Object.fromEntries(Object.keys(globals.vitest).map(e => [e, true])),
9290
"rules": {
9391
"unicorn/consistent-function-scoping": [0],
94-
"vitest/consistent-test-filename": [0],
95-
"vitest/consistent-test-it": [0],
96-
"vitest/expect-expect": [0],
97-
"vitest/max-expects": [0],
98-
"vitest/max-nested-describe": [0],
99-
"vitest/no-alias-methods": [0],
100-
"vitest/no-commented-out-tests": [0],
101-
"vitest/no-conditional-expect": [0],
102-
"vitest/no-conditional-in-test": [0],
103-
"vitest/no-conditional-tests": [0],
104-
"vitest/no-disabled-tests": [0],
105-
"vitest/no-done-callback": [0],
106-
"vitest/no-duplicate-hooks": [0],
107-
"vitest/no-focused-tests": [0],
108-
"vitest/no-hooks": [0],
109-
"vitest/no-identical-title": [2],
110-
"vitest/no-interpolation-in-snapshots": [0],
111-
"vitest/no-large-snapshots": [0],
112-
"vitest/no-mocks-import": [0],
113-
"vitest/no-restricted-matchers": [0],
114-
"vitest/no-restricted-vi-methods": [0],
115-
"vitest/no-standalone-expect": [0],
116-
"vitest/no-test-prefixes": [0],
117-
"vitest/no-test-return-statement": [0],
118-
"vitest/prefer-called-with": [0],
119-
"vitest/prefer-comparison-matcher": [0],
120-
"vitest/prefer-each": [0],
121-
"vitest/prefer-equality-matcher": [0],
122-
"vitest/prefer-expect-resolves": [0],
123-
"vitest/prefer-hooks-in-order": [0],
124-
"vitest/prefer-hooks-on-top": [2],
125-
"vitest/prefer-lowercase-title": [0],
126-
"vitest/prefer-mock-promise-shorthand": [0],
127-
"vitest/prefer-snapshot-hint": [0],
128-
"vitest/prefer-spy-on": [0],
129-
"vitest/prefer-strict-equal": [0],
130-
"vitest/prefer-to-be": [0],
131-
"vitest/prefer-to-be-falsy": [0],
132-
"vitest/prefer-to-be-object": [0],
133-
"vitest/prefer-to-be-truthy": [0],
134-
"vitest/prefer-to-contain": [0],
135-
"vitest/prefer-to-have-length": [0],
136-
"vitest/prefer-todo": [0],
137-
"vitest/require-hook": [0],
138-
"vitest/require-to-throw-message": [0],
139-
"vitest/require-top-level-describe": [0],
140-
"vitest/valid-describe-callback": [2],
141-
"vitest/valid-expect": [2],
142-
"vitest/valid-title": [2],
92+
"@vitest/consistent-test-filename": [0],
93+
"@vitest/consistent-test-it": [0],
94+
"@vitest/expect-expect": [0],
95+
"@vitest/max-expects": [0],
96+
"@vitest/max-nested-describe": [0],
97+
"@vitest/no-alias-methods": [0],
98+
"@vitest/no-commented-out-tests": [0],
99+
"@vitest/no-conditional-expect": [0],
100+
"@vitest/no-conditional-in-test": [0],
101+
"@vitest/no-conditional-tests": [0],
102+
"@vitest/no-disabled-tests": [0],
103+
"@vitest/no-done-callback": [0],
104+
"@vitest/no-duplicate-hooks": [0],
105+
"@vitest/no-focused-tests": [0],
106+
"@vitest/no-hooks": [0],
107+
"@vitest/no-identical-title": [2],
108+
"@vitest/no-interpolation-in-snapshots": [0],
109+
"@vitest/no-large-snapshots": [0],
110+
"@vitest/no-mocks-import": [0],
111+
"@vitest/no-restricted-matchers": [0],
112+
"@vitest/no-restricted-vi-methods": [0],
113+
"@vitest/no-standalone-expect": [0],
114+
"@vitest/no-test-prefixes": [0],
115+
"@vitest/no-test-return-statement": [0],
116+
"@vitest/prefer-called-with": [0],
117+
"@vitest/prefer-comparison-matcher": [0],
118+
"@vitest/prefer-each": [0],
119+
"@vitest/prefer-equality-matcher": [0],
120+
"@vitest/prefer-expect-resolves": [0],
121+
"@vitest/prefer-hooks-in-order": [0],
122+
"@vitest/prefer-hooks-on-top": [2],
123+
"@vitest/prefer-lowercase-title": [0],
124+
"@vitest/prefer-mock-promise-shorthand": [0],
125+
"@vitest/prefer-snapshot-hint": [0],
126+
"@vitest/prefer-spy-on": [0],
127+
"@vitest/prefer-strict-equal": [0],
128+
"@vitest/prefer-to-be": [0],
129+
"@vitest/prefer-to-be-falsy": [0],
130+
"@vitest/prefer-to-be-object": [0],
131+
"@vitest/prefer-to-be-truthy": [0],
132+
"@vitest/prefer-to-contain": [0],
133+
"@vitest/prefer-to-have-length": [0],
134+
"@vitest/prefer-todo": [0],
135+
"@vitest/require-hook": [0],
136+
"@vitest/require-to-throw-message": [0],
137+
"@vitest/require-top-level-describe": [0],
138+
"@vitest/valid-describe-callback": [2],
139+
"@vitest/valid-expect": [2],
140+
"@vitest/valid-title": [2],
143141
},
144142
},
145143
{

index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,13 @@ import noUseExtendNative from "eslint-plugin-no-use-extend-native";
77
import regexp from "eslint-plugin-regexp";
88
import sonarjs from "eslint-plugin-sonarjs";
99
import unicorn from "eslint-plugin-unicorn";
10-
import vitest from "eslint-plugin-vitest";
10+
import vitest from "@vitest/eslint-plugin";
1111
import playwright from "eslint-plugin-playwright";
1212
import tsdoc from "eslint-plugin-tsdoc";
1313
// import storybook from "eslint-plugin-storybook";
1414
// import github from "eslint-plugin-github";
1515
import globals from "globals";
1616
import {deepMerge} from "deepie-merge";
17-
import vitestGlobalsPlugin from "eslint-plugin-vitest-globals";
1817
import eslintrc from "./eslintrc.js";
1918
import jsxA11y from "eslint-plugin-jsx-a11y";
2019
import react from "eslint-plugin-react";
@@ -133,7 +132,7 @@ export default [
133132
deepMerge(common, {
134133
plugins: {vitest},
135134
files: testOverride.files,
136-
languageOptions: {globals: {...vitestGlobalsPlugin.environments.env.globals}},
135+
languageOptions: {globals: {...globals.vitest}},
137136
rules: testOverride.files,
138137
} satisfies Linter.Config, {arrayExtend: true}),
139138
deepMerge(common, {

0 commit comments

Comments
 (0)