-
Notifications
You must be signed in to change notification settings - Fork 183
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
feat: Add initial TypeScript autocomplete support #35
Conversation
One thing you might want to add is the ability to configure In my storybook i use that to exclude the HTML attributes using |
@hipstersmoothie I might look into something like this as a follow-up PR. |
Looks great, any ETA on when this will be released? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Before starting webpack, if we detect a
tsconfig.json
file, we now use react-docgen-typescript to parse the prop types of all React components in the current working directory. For now, only string prop values are supported. On a component-by-component basis, we use the static types if they're available, otherwise we fall back to the existing strategy via parse-prop-types.There aren't any automated tests for this, but I've added a TypeScript example for manual testing. I've added a Cypress test for the existing autocomplete behaviour to ensure that we haven't regressed.
In order to test this automatically, we'll need to improve our test suite to support multiple test projects, but I'm happy to leave that for another PR.