ithaka / pharos

JSTOR's design system
https://pharos.jstor.org
MIT License
117 stars 15 forks source link

Convert component stories to TypeScript #447

Open daneah opened 1 year ago

daneah commented 1 year ago

The problem

Type safety is generally a productivity tool to aid in writing new code and avoiding regressions in existing code. Storybook is compatible with TypeScript and it would be nice to avoid type mismatches while authoring component stories.

The solution

Convert the current JSX story files to TSX and add type declarations accordingly.

Additional information

Patterns for using TypeScript for CSF aren't yet documented. This StackOverflow issue gives some leads on how to go about it.

daneah commented 1 year ago

This will likely require updating the TypeScript configuration, because right now the rootDir is packages/pharos/src/ but we're importing files that live in .storybook/.