11import eslintComments from "@eslint-community/eslint-plugin-eslint-comments" ;
22import commentsConfig from "@eslint-community/eslint-plugin-eslint-comments/configs" ;
33import js from "@eslint/js" ;
4- import jest from "eslint-plugin-jest " ;
4+ import vitest from "@vitest/ eslint-plugin" ;
55import perfectionist from "eslint-plugin-perfectionist" ;
66import preferArrowFunctions from "eslint-plugin-prefer-arrow-functions" ;
77import prettierRecommended from "eslint-plugin-prettier/recommended" ;
@@ -25,7 +25,6 @@ export default tseslint.config(
2525 } ,
2626 plugins : {
2727 "eslint-comments" : eslintComments ,
28- jest,
2928 "prefer-arrow-functions" : preferArrowFunctions ,
3029 } ,
3130 rules : {
@@ -143,41 +142,53 @@ export default tseslint.config(
143142 } ,
144143 } ,
145144 {
146- ...jest . configs [ "flat/recommended" ] ,
147- ...jest . configs [ "flat/style" ] ,
148- files : [ "__tests__/**/*.test.ts" ] ,
145+ files : [ "tests/**/*.test.ts" ] ,
146+ ...vitest . configs . recommended ,
149147 rules : {
150- ...jest . configs [ "flat/recommended" ] . rules ,
151- ...jest . configs [ "flat/style" ] . rules ,
152- "jest/consistent-test-it" : [ "error" , { withinDescribe : "test" } ] ,
153- "jest/no-conditional-in-test" : "error" ,
154- "jest/no-confusing-set-timeout" : "error" ,
155- "jest/no-duplicate-hooks" : "error" ,
156- "jest/no-test-return-statement" : "error" ,
157- "jest/no-untyped-mock-factory" : "error" ,
158- "jest/padding-around-all" : "error" ,
159- "jest/prefer-called-with" : "error" ,
160- "jest/prefer-comparison-matcher" : "error" ,
161- "jest/prefer-each" : "error" ,
162- "jest/prefer-equality-matcher" : "error" ,
163- "jest/prefer-expect-assertions" : [
148+ ...vitest . configs . recommended . rules ,
149+ "vitest/consistent-test-it" : [ "error" , { withinDescribe : "test" } ] ,
150+ "vitest/no-alias-methods" : "error" ,
151+ "vitest/no-conditional-expect" : "error" ,
152+ "vitest/no-conditional-in-test" : "error" ,
153+ "vitest/no-conditional-tests" : "error" ,
154+ "vitest/no-disabled-tests" : "error" ,
155+ "vitest/no-duplicate-hooks" : "error" ,
156+ "vitest/no-focused-tests" : "error" ,
157+ "vitest/no-interpolation-in-snapshots" : "error" ,
158+ "vitest/no-large-snapshots" : "error" ,
159+ "vitest/no-mocks-import" : "error" ,
160+ "vitest/no-standalone-expect" : "error" ,
161+ "vitest/no-test-prefixes" : "error" ,
162+ "vitest/no-test-return-statement" : "error" ,
163+ "vitest/padding-around-all" : "error" ,
164+ "vitest/prefer-called-with" : "error" ,
165+ "vitest/prefer-comparison-matcher" : "error" ,
166+ "vitest/prefer-each" : "error" ,
167+ "vitest/prefer-equality-matcher" : "error" ,
168+ "vitest/prefer-expect-assertions" : [
164169 "error" ,
165170 {
166171 onlyFunctionsWithAsyncKeyword : true ,
167172 onlyFunctionsWithExpectInCallback : true ,
168173 onlyFunctionsWithExpectInLoop : true ,
169174 } ,
170175 ] ,
171- "jest/prefer-expect-resolves" : "error" ,
172- "jest/prefer-hooks-in-order" : "error" ,
173- "jest/prefer-hooks-on-top" : "error" ,
174- "jest/prefer-jest-mocked" : "error" ,
175- "jest/prefer-mock-promise-shorthand" : "error" ,
176- "jest/prefer-spy-on" : "error" ,
177- "jest/prefer-strict-equal" : "error" ,
178- "jest/require-hook" : "error" ,
179- "jest/require-to-throw-message" : "error" ,
180- "jest/unbound-method" : "error" ,
176+ "vitest/prefer-expect-resolves" : "error" ,
177+ "vitest/prefer-hooks-in-order" : "error" ,
178+ "vitest/prefer-hooks-on-top" : "error" ,
179+ "vitest/prefer-mock-promise-shorthand" : "error" ,
180+ "vitest/prefer-snapshot-hint" : "error" ,
181+ "vitest/prefer-spy-on" : "error" ,
182+ "vitest/prefer-strict-equal" : "error" ,
183+ "vitest/prefer-to-be" : "error" ,
184+ "vitest/prefer-to-be-object" : "error" ,
185+ "vitest/prefer-to-contain" : "error" ,
186+ "vitest/prefer-to-have-length" : "error" ,
187+ "vitest/prefer-todo" : "error" ,
188+ "vitest/prefer-vi-mocked" : "error" ,
189+ "vitest/require-hook" : "error" ,
190+ "vitest/require-to-throw-message" : "error" ,
191+ "vitest/valid-expect-in-promise" : "error" ,
181192 } ,
182193 } ,
183194 {
0 commit comments