Skip to content

Commit 53aebec

Browse files
committed
fix(repo): configure ESLint for .storybook TypeScript files
Add ESLint configuration to use custom-components tsconfig.json for .storybook directory files Include .storybook/**/* in custom-components tsconfig.json Add ts,tsx extensions to lint:eslint script
1 parent ce8da65 commit 53aebec

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

eslint.config.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ export default [
1616
'import-x/no-extraneous-dependencies': 0,
1717
},
1818
},
19+
{
20+
files: ['**/.storybook/**/*.ts'],
21+
languageOptions: {
22+
parserOptions: {
23+
project: [path.resolve('packages/@d-zero/custom-components/tsconfig.json')],
24+
},
25+
},
26+
},
1927
{
2028
ignores: [
2129
...scaffold.flatMap(

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"test": "vitest run --test-timeout 60000",
1313
"lint": "run-s lint:eslint lint:prettier lint:textlint lint:cspell",
1414
"lint:cspell": "npx cspell --no-progress --show-suggestions \"**\"",
15-
"lint:eslint": "npx eslint --fix \"./{*,**/*}.{js,cjs,mjs}\"",
15+
"lint:eslint": "npx eslint --fix \"./{*,**/*}.{js,cjs,mjs,ts,tsx}\"",
1616
"lint:prettier": "npx prettier --write \"{*,./**/*}{.{md,mdc,mdx,js,jsx,ts,tsx,css,pug,html},*rc}\" \"!**/{dist,storybook-static}/**/*\"",
1717
"lint:textlint": "npx textlint --fix \"{*,./**/*}.{md,mdc}\" && npx textlint \"{*,./**/*}.{md,mdc}\"",
1818
"storybook": "lerna run storybook --scope=@d-zero/custom-components",

packages/@d-zero/custom-components/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
"compilerOptions": {
44
"jsx": "preserve"
55
},
6+
"include": ["src/**/*", ".storybook/**/*"],
67
"exclude": ["node_modules", "dist", "storybook-static"]
78
}

0 commit comments

Comments
 (0)