@@ -4,6 +4,7 @@ import { fileURLToPath } from 'node:url';
4
4
import vueEslintParser from 'vue-eslint-parser' ;
5
5
import { includeIgnoreFile } from '@eslint/compat' ;
6
6
import tsEslintParser from '@typescript-eslint/parser' ;
7
+ import vitest from '@vitest/eslint-plugin' ;
7
8
import vuePrettierConfig from '@vue/eslint-config-prettier' ;
8
9
import globals from 'globals' ;
9
10
import withNuxt from './.nuxt/eslint.config.mjs' ;
@@ -84,5 +85,26 @@ export default withNuxt([
84
85
] ,
85
86
} ,
86
87
} ,
88
+ {
89
+ files : [ '**/__test__/**' , '**/__tests__/**' , '**/tests/**' , '**/test/**' ] ,
90
+ plugins : {
91
+ vitest,
92
+ } ,
93
+ rules : {
94
+ ...vitest . configs . recommended . rules ,
95
+ 'vitest/consistent-test-it' : [ 'error' , { fn : 'test' , withinDescribe : 'test' } ] ,
96
+ 'vitest/no-conditional-expect' : 'error' ,
97
+ 'vitest/no-conditional-in-test' : 'error' ,
98
+ 'vitest/no-conditional-tests' : 'error' ,
99
+ 'vitest/no-disabled-tests' : 'error' ,
100
+ 'vitest/no-duplicate-hooks' : 'error' ,
101
+ 'vitest/no-identical-title' : 'error' ,
102
+ 'vitest/no-test-return-statement' : 'error' ,
103
+ 'vitest/prefer-mock-promise-shorthand' : 'error' ,
104
+ 'vitest/require-hook' : 'error' ,
105
+ 'vitest/require-to-throw-message' : 'error' ,
106
+ 'vitest/require-top-level-describe' : [ 'error' , { maxNumberOfTopLevelDescribes : 2 } ] ,
107
+ } ,
108
+ } ,
87
109
vuePrettierConfig ,
88
110
] ) ;
0 commit comments