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

Rules for forced typing Meta and Stories #137

Open
dartess opened this issue Aug 3, 2023 · 2 comments
Open

Rules for forced typing Meta and Stories #137

dartess opened this issue Aug 3, 2023 · 2 comments

Comments

@dartess
Copy link

dartess commented Aug 3, 2023

Is your feature request related to a problem? Please describe.

Each default export must be typed as Meta. Each exported story must be typed as StoryObj.

Describe the solution you'd like

export default must be an object and must contain satisfies Meta< ... >

export ... should be typed as StoryObj< ... > or Story (https://storybook.js.org/docs/react/configure/typescript#write-stories-with-typescript)

@dartess
Copy link
Author

dartess commented Aug 4, 2023

I made implementations for internal use, they are suitable for our case, but I'm sure they do not cover many edge cases.

https://gist.github.com/dartess/615fd442461db793a417def8e5060681

@hjoelh
Copy link
Contributor

hjoelh commented Aug 8, 2023

Add meta-satisfies-type rule #124

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants