Skip to content

Commit

Permalink
update story globs
Browse files Browse the repository at this point in the history
  • Loading branch information
yannbf committed Jul 2, 2024
1 parent 817e950 commit 92c47e4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Optionally, you can override, add or disable rules settings. You likely don't wa
"overrides": [
{
// or whatever matches stories specified in .storybook/main.js
"files": ['*.stories.@(ts|tsx|js|jsx|mjs|cjs)'],
"files": ['**/*.stories.@(ts|tsx|js|jsx|mjs|cjs)'],
"rules": {
// example of overriding a rule
'storybook/hierarchy-separator': 'error',
Expand Down Expand Up @@ -137,7 +137,7 @@ export default [

...storybook.configs['flat/recommended'],
{
files: ['*.stories.@(ts|tsx|js|jsx|mjs|cjs)'],
files: ['**/*.stories.@(ts|tsx|js|jsx|mjs|cjs)'],
rules: {
// example of overriding a rule
'storybook/hierarchy-separator': 'error',
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/hierarchy-separator.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ For more details about this change: https://github.com/storybookjs/storybook/blo
To automatically migrate all of your codebase and fix this issue, run this codemod in the root folder of your project:

```sh
npx sb@next migrate upgrade-hierarchy-separators --glob="*/**/*.stories.@(tsx|jsx|ts|js)"
npx storybook@latest migrate upgrade-hierarchy-separators --glob="*/**/*.stories.@(tsx|jsx|ts|js)"
```
2 changes: 1 addition & 1 deletion docs/rules/no-stories-of.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@ For more information about the change from `storiesOf` to `CSF`, read here: http
To automatically migrate all of your codebase, run this codemod in the root folder of your project:

```sh
npx sb@next migrate storiesof-to-csf --glob="*/**/*.stories.@(tsx|jsx|ts|js)"
npx storybook@latest migrate storiesof-to-csf --glob="*/**/*.stories.@(tsx|jsx|ts|js)"
```
4 changes: 2 additions & 2 deletions tools/utils/updates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ export function formatSingleRule(rules: TCategory['rules'], ruleId: string) {

export const SUPPORTED_EXTENSIONS = ['ts', 'tsx', 'js', 'jsx', 'mjs', 'cjs']
export const STORIES_GLOBS = [
`'*.stories.@(${SUPPORTED_EXTENSIONS.join('|')})'`,
`'*.story.@(${SUPPORTED_EXTENSIONS.join('|')})'`,
`'**/*.stories.@(${SUPPORTED_EXTENSIONS.join('|')})'`,
`'**/*.story.@(${SUPPORTED_EXTENSIONS.join('|')})'`,
]

// Other files that will be linted
Expand Down

0 comments on commit 92c47e4

Please sign in to comment.