From 0d14ec2a5bbdbd96b0ab512bc376090197636e55 Mon Sep 17 00:00:00 2001 From: Yann Braga Date: Tue, 7 May 2024 09:04:41 +0200 Subject: [PATCH] add more files to default filter --- src/constants.ts | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/constants.ts b/src/constants.ts index 1e5e622..dc7d287 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -1,8 +1,6 @@ +const commonExtensions = [".js", ".cjs", ".mjs", ".ts", ".cts", ".mts"]; export const defaultExtensions = [ - ".js", - ".cjs", - ".mjs", - ".ts", + ...commonExtensions, ".tsx", ".jsx", ".vue", @@ -12,21 +10,26 @@ const testFileExtensions = defaultExtensions .map((extension) => extension.slice(1)) .join(","); +const configFileExtensions = commonExtensions + .map((extension) => extension.slice(1)) + .join(","); + export const defaultExclude = [ "**/node_modules/**", ".storybook/**", "coverage/**", "packages/*/test{,s}/**", "**/*.d.ts", + "**/*.mock.*", "test{,s}/**", `test{,-*}.{${testFileExtensions}}`, - `**/*{.,-}{spec,stories,types}.{${testFileExtensions}}`, + `**/*{.,-}{spec,story,stories,types}.{${testFileExtensions}}`, "**/__tests__/**", "**/*-entry.js", /* Exclude common development tool configuration files */ - "**/{ava,babel,nyc}.config.{js,cjs,mjs}", - "**/jest.config.{js,cjs,mjs,ts}", - "**/{karma,rollup,webpack}.config.js", - "**/.{eslint,mocha}rc.{js,cjs}", + `**/{ava,babel,nyc}.config.{${configFileExtensions}}`, + `**/{jest,vitest}.config.{${configFileExtensions}}`, + `**/{karma,rollup,webpack,vite}.config.{${configFileExtensions}}`, + `**/.{eslint,mocha}rc.{${configFileExtensions}}`, ];