Skip to content

Commit

Permalink
fix: properly disable top-level-await rule for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
daflyinbed committed Nov 4, 2024
1 parent 293b007 commit 7e519dd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
7 changes: 0 additions & 7 deletions src/configs/disables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,6 @@ export async function disables(): Promise<TypedFlatConfigItem[]> {
"unused-imports/no-unused-vars": "off",
},
},
{
files: ["**/*.{test,spec}.([tj])s?(x)"],
name: "xwbx/disables/test",
rules: {
"no-unused-expressions": "off",
},
},
{
files: ["**/*.js", "**/*.cjs"],
name: "xwbx/disables/cjs",
Expand Down
13 changes: 9 additions & 4 deletions src/configs/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,25 @@ export async function test(
},
files,
rules: {
"node/prefer-global/process": "off",

"test/consistent-test-it": [
"error",
{ fn: "it", withinDescribe: "it" },
],
"test/no-identical-title": "error",
"test/no-import-node-test": "error",
"test/no-only-tests": isInEditor ? "off" : "error",

"test/prefer-hooks-in-order": "error",
"test/prefer-lowercase-title": "error",

"ts/explicit-function-return-type": "off",
"unicorn/consistent-function-scoping": "off",
// Disables
...{
"unicorn/consistent-function-scoping": "off",
"antfu/no-top-level-await": "off",
"no-unused-expressions": "off",
"node/prefer-global/process": "off",
"ts/explicit-function-return-type": "off",
},

...overrides,
},
Expand Down

0 comments on commit 7e519dd

Please sign in to comment.