Open donaldpipowitch opened 8 months ago
Hey @donaldpipowitch that's an interesting idea! It does feel a little weird though because the eslint rules for this plugin only apply to storybook-specific files e.g. *.stories.@(ts|tsx|js|jsx|mjs|cjs)
and .storybook/main.@(js|cjs|mjs|ts)
.
Maybe the plugin could have a rule that is not applied to any file, and users would have to manually apply such rule in an overrides field, like:
{
overrides: [
{
files: ['*.test.@(ts|tsx|js|jsx|mjs|cjs)', '*.spec.@(ts|tsx|js|jsx|mjs|cjs)'],
rules: {
'storybook/use-compose-stories': 'warn'
},
},
]
}
That sounds great!
Is your feature request related to a problem? Please describe.
I always find it annoying that when my Storybook examples grow in complexity (e.g. decorators get added) I have to go back to test files and manually add
composeStories
. It would be way nicer if everyone in the project would start to write tests withcomposeStories
from the beginning.Describe the solution you'd like
It should not be possible to do something like this:
Only this should be allowed:
Describe alternatives you've considered ...
Additional context ...