diff --git a/.changesets/11748.md b/.changesets/11748.md new file mode 100644 index 000000000000..5df3e14887ff --- /dev/null +++ b/.changesets/11748.md @@ -0,0 +1 @@ +- Include .storybook folder in Linting (#11748) by @Philzen diff --git a/packages/cli/src/commands/lint.js b/packages/cli/src/commands/lint.js index 7857429de11c..5c605b3f4c71 100644 --- a/packages/cli/src/commands/lint.js +++ b/packages/cli/src/commands/lint.js @@ -42,6 +42,9 @@ export const handler = async ({ path, fix }) => { fix && '--fix', !pathString && fs.existsSync(getPaths().web.src) && 'web/src', !pathString && fs.existsSync(getPaths().web.config) && 'web/config', + !pathString && + fs.existsSync(getPaths().web.storybook) && + 'web/.storybook', !pathString && fs.existsSync(getPaths().scripts) && 'scripts', !pathString && fs.existsSync(getPaths().api.src) && 'api/src', pathString, diff --git a/packages/eslint-config/index.js b/packages/eslint-config/index.js index 06cced2c1292..e7ecdf9c50cd 100644 --- a/packages/eslint-config/index.js +++ b/packages/eslint-config/index.js @@ -55,6 +55,8 @@ module.exports = { './shared.js', config.web.a11y && 'plugin:jsx-a11y/recommended', ].filter(Boolean), + // This is merged with `ignorePatterns` in shared.js + ignorePatterns: ['!.storybook/'], parserOptions: { requireConfigFile: false, babelOptions: getProjectBabelOptions(), diff --git a/packages/eslint-config/shared.js b/packages/eslint-config/shared.js index 15a024a177cd..70fcecc7f354 100644 --- a/packages/eslint-config/shared.js +++ b/packages/eslint-config/shared.js @@ -32,7 +32,10 @@ module.exports = { 'jest-dom', '@redwoodjs', ], - ignorePatterns: ['node_modules', 'dist'], + // In addition to this, eslint also has some implicit ignore patterns, like + // `node_modules`. + // See https://eslint.org/docs/latest/use/configure/ignore-deprecated + ignorePatterns: ['dist'], settings: { react: { version: 'detect',