Description
What
We want to step our TS game in the monorepo and enable strict typescript in all packages!
Why
Having TS track for you if a variable might be null or not, enables us to code with much more confidence,
and also gives us quick in editor feedback, when you make assumptions that are not actually true!
How
Feel free to contribute to any of packages in the list below!
After you cloned the repo, you can best run this command:
yarn task --task check --no-link --start-from=install
This will install all dependencies, compile it (including dts files, that is what no-link does), and then check typescript errors in all packages.
To enable strict mode you will need:
- Change in
tsconfig.json
"strict": false
->"strict": true
- Run
yarn check
in the directory of the package. - Fix all TS errors.
We would like to change as little as possible of the actual runtime behavior in this migration.
However, we also don't want to simply silence the compiler in every error with !
, as
or ts-ignore
to get this migration in.
As a rule of thumb, if the logic is easy enough, prefer improving the code (e.g. add a null check, throw when not null, possibly use https://github.com/alexreardon/tiny-invariant) over silencing the compiler.
If the change needed to do the right thing, is too risky, and not in your expertise, it is okay to silence the compiler.
It is not ideal, but we still gain the benefit that new code written will have extra typesafety.
package name | assign to | merged | PR |
---|---|---|---|
@storybook/addon-backgrounds | @kasperpeulen | #22178 | |
@storybook/addon-docs | @kasperpeulen | ✅ | #22180 |
@storybook/addon-highlight | @kasperpeulen | ✅ | #22181 |
@storybook/addon-interactions | @kasperpeulen | ||
@storybook/addon-jest | @Gufah | ✅ | #22389 |
@storybook/addon-mdx-gfm | @1234tgk | ✅ | #22659 |
@storybook/addon-measure | @efrenaragon96 | #22402 | |
@storybook/addon-outline | @kyletsang | ✅ | #22369 |
@storybook/addon-storyshots | @1234tgk | ✅ | #22487 |
@storybook/addon-storyshots-puppeteer | @1234tgk | ✅ | #22407 |
@storybook/addon-storysource | @1234tgk | ✅ | #22367 |
@storybook/addon-viewport | @1234tgk | ✅ | #22339 |
@storybook/addons | @Beadko | ||
@storybook/angular | @1234tgk | ||
@storybook/api | |||
@storybook/blocks | @ssingh3856 | ||
@storybook/channel-postmessage | @EDuToit | ✅ | #22335 |
@storybook/channel-websocket | @EDuToit | ✅ | #22364 |
@storybook/channels | @EDuToit | ✅ | #22365 |
@storybook/cli | @0916dhkim | #22254 | |
@storybook/client-api | @efrenaragon96 | ✅ | #22421 |
@storybook/codemod | |||
@storybook/components | @Beadko | #22569 | |
@storybook/core-client | @kolife01 | ✅ | #22447 |
@storybook/core-events | @kolife01 | ✅ | #22447 |
@storybook/core-server | @stilt0n | ✅ | #23182 |
@storybook/csf-tools | @usrrname | ✅ | #22312 |
@storybook/docs-tools | @efrenaragon96 | #22567 | |
@storybook/external-docs | |||
@storybook/html-vite | @usrrname | ✅ | #22293 |
@storybook/instrumenter | @kyletsang | ✅ | #22370 |
@storybook/manager | @Dobariya-Nishant | ||
@storybook/manager-api | @subhajit20 | ||
@storybook/postinstall | @kuriacka | ✅ | #22200 |
@storybook/preact-vite | @mariasimo | ||
@storybook/preset-create-react-app | @kuriacka | ||
@storybook/preset-vue-webpack | @kyletsang | ✅ | #22320 |
@storybook/preset-vue3-webpack | @chakAs3 | ✅ | #23377 |
@storybook/react-vite | @mariasimo | ✅ | #22428 |
@storybook/router | @kuriacka | ✅ | #22200 |
@storybook/scripts | |||
@storybook/server | @unpunnyfuns | ||
@storybook/source-loader | @usrrname | ✅ | #22420 |
@storybook/svelte-vite | @kolife01 | ✅ | #22411 |
@storybook/sveltekit | @kolife01 | ✅ | #22412 |
@storybook/theming | @kuriacka | ✅ | #22376 |
@storybook/types | @kuriacka | ✅ | #22397 |
@storybook/vue3-vite | @chakAs3 | ✅ | #23375 |
@storybook/vue3-webpack5 | @chakAs3 | ✅ | #23376 |
@storybook/web-components | @efrenaragon96 | #22399 | |
@storybook/web-components-vite | @usrrname | ✅ | #22309 |
So if you'd like to help converting any of these
If you need any help, please reach out to storybook maintainers on the contributing channel on the Storybook discord.