File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,9 @@ import type {
7
7
TypedFlatConfigItem ,
8
8
} from '../types'
9
9
10
+ // Hold the reference so we don't redeclare the plugin on each call
11
+ let _pluginTest : any
12
+
10
13
export async function test (
11
14
options : OptionsFiles & OptionsIsInEditor & OptionsOverrides = { } ,
12
15
) : Promise < TypedFlatConfigItem [ ] > {
@@ -18,18 +21,20 @@ export async function test(
18
21
interopDefault ( import ( 'eslint-plugin-no-only-tests' ) ) ,
19
22
] as const )
20
23
24
+ _pluginTest = _pluginTest || {
25
+ ...pluginVitest ,
26
+ rules : {
27
+ ...pluginVitest . rules ,
28
+ // extend `test/no-only-tests` rule
29
+ ...pluginNoOnlyTests . rules ,
30
+ } ,
31
+ }
32
+
21
33
return [
22
34
{
23
35
name : 'coderwyd/test/setup' ,
24
36
plugins : {
25
- test : {
26
- ...pluginVitest ,
27
- rules : {
28
- ...pluginVitest . rules ,
29
- // extend `test/no-only-tests` rule
30
- ...pluginNoOnlyTests . rules ,
31
- } ,
32
- } ,
37
+ test : _pluginTest ,
33
38
} ,
34
39
} ,
35
40
{
You can’t perform that action at this time.
0 commit comments