Skip to content

Commit

Permalink
Include .storybook folder in Linting (#11748)
Browse files Browse the repository at this point in the history
Co-authored-by: Tobbe Lundberg <[email protected]>
  • Loading branch information
Philzen and Tobbe authored Dec 9, 2024
1 parent 33a9d4b commit 776403f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions .changesets/11748.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Include .storybook folder in Linting (#11748) by @Philzen
3 changes: 3 additions & 0 deletions packages/cli/src/commands/lint.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions packages/eslint-config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
5 changes: 4 additions & 1 deletion packages/eslint-config/shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 776403f

Please sign in to comment.