Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rule: add story-exports #44

Merged
merged 4 commits into from
Nov 12, 2021
Merged

Rule: add story-exports #44

merged 4 commits into from
Nov 12, 2021

Conversation

yannbf
Copy link
Member

@yannbf yannbf commented Nov 12, 2021

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:

  • Ran yarn update-all
  • Tests are updated
  • Documentation is updated

Change Type

Indicate the type of change your pull request is:

  • maintenance
  • documentation
  • patch
  • minor
  • major

@yannbf
Copy link
Member Author

yannbf commented Nov 12, 2021

@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

@shilman
Copy link
Member

shilman commented Nov 12, 2021

  • story-exports WFM
  • let's do option1 for now and then do option3 as part of the CSF3 launch

@yannbf yannbf added release Create a release when this pr is merged minor Increment the minor version when merged labels Nov 12, 2021
@yannbf yannbf merged commit 4537386 into main Nov 12, 2021
@yannbf yannbf deleted the feat/story-exports-rule branch November 12, 2021 16:08
@github-actions
Copy link

🚀 PR was released in v0.4.0 🚀

@github-actions github-actions bot added the released This issue/pull request has been released. label Nov 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor Increment the minor version when merged release Create a release when this pr is merged released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants