From 5f391da76b6bec9489ab5382f27c9fbdc5758df2 Mon Sep 17 00:00:00 2001 From: Naomi Carrigan Date: Fri, 27 Sep 2024 01:49:28 +0000 Subject: [PATCH] fix: tweak rules for linting spec files (!5) Reviewed-on: https://codeberg.org/nhcarrigan/eslint-config/pulls/5 Co-authored-by: Naomi Carrigan Co-committed-by: Naomi Carrigan --- src/rules/import.ts | 2 +- src/rules/vitest.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rules/import.ts b/src/rules/import.ts index 1f0fe7e..a250d5d 100644 --- a/src/rules/import.ts +++ b/src/rules/import.ts @@ -25,7 +25,7 @@ export const importRules: Linter.RulesRecord = { "import/no-empty-named-blocks": "error", "import/no-extraneous-dependencies": [ "error", - { devDependencies: [ "**/*.test.js", "**/*.spec.js" ] }, + { devDependencies: [ "**/*.spec.ts" ] }, ], "import/no-import-module-exports": [ "error" ], "import/no-mutable-exports": "error", diff --git a/src/rules/vitest.ts b/src/rules/vitest.ts index 9944bd4..0896d08 100644 --- a/src/rules/vitest.ts +++ b/src/rules/vitest.ts @@ -8,7 +8,7 @@ import type { Linter } from "eslint"; export const vitestRules: Linter.RulesRecord = { "vitest/consistent-test-filename": - [ "warn", { pattern: /^[\da-z-]+\.spec\.ts$/ } ], + [ "warn", { pattern: /^[\da-z-]+\.spec\.ts$/i } ], "vitest/consistent-test-it": "warn", "vitest/expect-expect": "warn", "vitest/max-nested-describe": [ "warn", { max: 2 } ],