Closed yannbf closed 2 years ago
@shilman two questions:
is story-exports
a good name or maybe named-exports
is better? I chose story-exports
because you can have non-story exports in story files.
I'm not sure what to do with the output of the auto fix. I added a CSF3 example for now. A few options that we can choose:
1 - Only report and not autofix the issue
2 - Report and autofix with export const Default = {}
and let people deal with the story (at least for now)
3 - Report and autofix with export const Default = {}
and add a comment on top with a link: https://storybook.js.org/docs/react/writing-stories/introduction
4 - Add a setting field to ESLint so people define a framework (maybe CSF version as well), and based on the framework we can provide a better autofix and a correct docs link to the specific framework
story-exports
WFM:rocket: PR was released in v0.4.0
:rocket:
Issue: #42
What Changed
Added a new rule
story-exports
to enforce defining at least one named export in a story file.Checklist
Check the ones applicable to your change:
yarn update-all
Change Type
Indicate the type of change your pull request is:
maintenance
documentation
patch
minor
major