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