Skip to content

Commit e914ae4

Browse files
committed
fix: properly disable top-level-await rule for tests
1 parent 582ade4 commit e914ae4

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

src/configs/disables.ts

-8
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,6 @@ export async function disables(): Promise<TypedFlatConfigItem[]> {
3939
'unused-imports/no-unused-vars': 'off',
4040
},
4141
},
42-
{
43-
files: ['**/*.{test,spec}.([tj])s?(x)'],
44-
name: 'antfu/disables/test',
45-
rules: {
46-
'antfu/no-top-level-await': 'off',
47-
'no-unused-expressions': 'off',
48-
},
49-
},
5042
{
5143
files: ['**/*.js', '**/*.cjs'],
5244
name: 'antfu/disables/cjs',

src/configs/test.ts

+8-3
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,21 @@ export async function test(
4444
files,
4545
name: 'antfu/test/rules',
4646
rules: {
47-
'node/prefer-global/process': 'off',
48-
4947
'test/consistent-test-it': ['error', { fn: 'it', withinDescribe: 'it' }],
5048
'test/no-identical-title': 'error',
5149
'test/no-import-node-test': 'error',
5250
'test/no-only-tests': isInEditor ? 'off' : 'error',
51+
5352
'test/prefer-hooks-in-order': 'error',
5453
'test/prefer-lowercase-title': 'error',
5554

56-
'ts/explicit-function-return-type': 'off',
55+
// Disables
56+
...{
57+
'antfu/no-top-level-await': 'off',
58+
'no-unused-expressions': 'off',
59+
'node/prefer-global/process': 'off',
60+
'ts/explicit-function-return-type': 'off',
61+
},
5762

5863
...overrides,
5964
},

0 commit comments

Comments
 (0)