-
Notifications
You must be signed in to change notification settings - Fork 508
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
stories dir is not being type checked during Storybook build #668
Comments
Ah, this was one of the things I was worried about in #646 / the fix to #638 , that files outside of Per the PR, I wasn't able to repro that in editor, but sounds like The fix is to have a separate More specifically, the missing piece here is to change We don't want that |
Ok, well I tried and I couldn't reproduce this with the template config because the template config has I then tried removing that as well and temporarily adding Pinging our "resident Storybook expert" (😉 ) @kylemh for input on both of the above |
Pinging @kylemh again as haven't gotten responses in multiple threads now... 😕 |
Sorry about being so silent. Been crazy busy with other objectives. Using TSDX with Storybook is gonna be a priority for me real soon at work, and that'll be when I fix the storybook template, unless somebody else takes a swing! The storybook typescript preset may automatically resolve the issues, but there are a lot of snafus if used with Storybook v5. See: #440 and https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#react-prop-tables-with-typescript for more Hoping to wait until Storybook v6 is released... @agilgur5 @sw-yx any chance of adding me as a collaborator and assigning me the Storybook issues? |
So has this been resolved in Storybook v6? I think it has since |
@agilgur5 my coworker @yhy-vertex will be investigating this in the next week or two. We’ll update you on our findings. :) |
I added an invalid prop and value to a story here (not committed) and was able to build storybook and use it's dev server without type errors, so my guess is that its hasn't been resolved. |
Ah! Looks like it does work! You just need to adjust the config in https://storybook.js.org/docs/react/configure/typescript#mainjs-configuration |
Current Behavior
If I have bad typescript code in
/stories/button.stories.tsx
(like the following code) I will not get a typescript build error when I'm either watching storybook or building storybook:Expected behavior
I should get a build error when running
build-storybook
that says:Cannot assign to 'falseAlways' because it is a constant.ts(2588)
Suggested solution(s)
Modify the
.storybook/main.js
in the templates and or thetsconfig.json
so thatts-loader
knows that it should be type checking the files.Additional context
This might be a problem due to the
noEmit
flag intsconfig.json
; however, I've tried turning file emitting back on and just simple directing it (viaoutDir
) to a different directory.I've used the default main.js but I've also tried adding to it to see if I can get better feedback:
Your environment
The text was updated successfully, but these errors were encountered: