Skip to content

Commit

Permalink
Merge pull request #41 from storybookjs/yann/filter-mock-files
Browse files Browse the repository at this point in the history
Add more files to default filter
  • Loading branch information
yannbf authored May 7, 2024
2 parents 73c8fd6 + 0d14ec2 commit 86ad6a3
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
const commonExtensions = [".js", ".cjs", ".mjs", ".ts", ".cts", ".mts"];
export const defaultExtensions = [
".js",
".cjs",
".mjs",
".ts",
...commonExtensions,
".tsx",
".jsx",
".vue",
Expand All @@ -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}}`,
];

0 comments on commit 86ad6a3

Please sign in to comment.