storybookjs / eslint-plugin-storybook

🎗Official ESLint plugin for Storybook
MIT License
248 stars 56 forks source link

storybook/story-exports rule doesn't support named exports list syntax #57

Closed stephenhmarsh closed 2 years ago

stephenhmarsh commented 2 years ago

Hello, apologies if this is not a bug but it sure seems like one to me.

Describe the bug eslint-plugin-storybook is throwing error The file should have at least one story export storybook/story-exports when using "named export list" syntax.

Example:

This fails:

const quotesList = () => {
...
};

export { quotesList };

This passes:

export const quotesList = () => {
...
};

To Reproduce

Expected behavior The named exports list syntax should be supported and this rule should not throw any errors on the example above?

Screenshots If applicable, add screenshots to help explain your problem.

Additional context This seems to have come from https://github.com/storybookjs/eslint-plugin-storybook/issues/42 and https://github.com/storybookjs/eslint-plugin-storybook/pull/44 so cc @yannbf - thanks.

yannbf commented 2 years ago

Hey @stephenhmarsh thanks for opening this issue! Although the export list syntax is not our recommended way to define stories, this is definitely a bug in the rule as it's supposed to check whether you are exporting stories or not. Thanks for the PR as well! It's people like you who make OSS great <3

github-actions[bot] commented 2 years ago

:rocket: Issue was released in v0.5.3 :rocket:

github-actions[bot] commented 2 years ago

:rocket: Issue was released in v0.5.3 :rocket: