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

extend story-exports rule to support export lists, fixes #57 #58

Merged
merged 2 commits into from
Dec 3, 2021
Merged

extend story-exports rule to support export lists, fixes #57 #58

merged 2 commits into from
Dec 3, 2021

Conversation

stephenhmarsh
Copy link

Issue: #57

What Changed

Fixed a bug where the story-exports rule gave a false negative because it did not check for exports from an export list, only from inline export declarations.

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

yannbf commented Dec 2, 2021

Hey @stephenhmarsh thanks a lot for your contribution! I moved the logic into a utility function so that it can be reused by other rules. I also changed the check from local to exported, although I'm not sure which would matter the most 🤔 @shilman thoughts?

const primary = {} <-- local name

export { primary } <-- exported name

@stephenhmarsh
Copy link
Author

Welcome! Yeah I just went with local initially because I wasn't sure either. Like, if someone does export { story1 as name1 }, how does that change things like checks against excludeStories, etc.?

@yannbf
Copy link
Member

yannbf commented Dec 3, 2021

Welcome! Yeah I just went with local initially because I wasn't sure either. Like, if someone does export { story1 as name1 }, how does that change things like checks against excludeStories, etc.?

the checks will be done with what's being exported from the package, therefore I believe we should go with the exported check!

@yannbf yannbf self-assigned this Dec 3, 2021
@yannbf yannbf added patch Increment the patch version when merged release Create a release when this pr is merged labels Dec 3, 2021
@yannbf yannbf merged commit 9266900 into storybookjs:main Dec 3, 2021
@yannbf
Copy link
Member

yannbf commented Dec 3, 2021

Thanks a lot for your contribution @stephenhmarsh !! Superb stuff 👌

@github-actions
Copy link

github-actions bot commented Dec 3, 2021

🚀 PR was released in v0.5.3 🚀

@github-actions github-actions bot added the released This issue/pull request has been released. label Dec 3, 2021
@stephenhmarsh
Copy link
Author

Awesome thanks @yannbf 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch Increment the patch 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.

None yet

2 participants