-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
First pass of typescript types for everything #3411
Conversation
This is awesome! Thanks a ton I'll review properly on Monday |
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.
🙏 thank you
oops can you fix the Travis CI error? |
Good timing, I was just looking at that! The failure seems to be caused by two issues, and I've just worked around it instead:
|
Hrm, I think actually typescript 3.1 was correct in flagging an error here, and 3.2 not erroring wasn't correct 🤔 |
That appveyor error doesn't seem to be down to anything I've changed - unless I've overlooked something? |
ya Appveyer is just been broken for a while. not your problem :P |
Welp, that took longer than I was expecting!
I think I've got a reasonable set of prop types for each module, but i got a bit tired of detailed checking towards the end.
I'm not sure whether the polymorphic
as
behaviour actually works correctly - although in theory the types I've got there should handle it.Because of the generated types for the final component props, the error messages can be a bit wordy - but they do seem to also include the important information as well.
I've added dtslint into the build, but unfortunately this only checks the types against the
simple.test.tsx
file, it doesn't check the types against the actual implementation in any way.Another mild annoyance is that although i've matched up the component filenames, the types don't work for the individual component files because of the
lib
vssrc
vses
part of the build process. In theory the files could be duplicated during the build for the exported code if this is desired.