-
Notifications
You must be signed in to change notification settings - Fork 11
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
Adding type annotations via flow type-at-pos? #30
Comments
Indeed that might be interesting, might be worth to experiment with. However, I am a bit skeptical about how beneficial that would be - my feeling is that in most cases where annotations are missing - TypeScript can successfully infer them, and so adding more flow based types might only increase amount of fixes to be made manually… Other thing in this direction, that might be more interesting to look into - codemod provided by flow team for "type first" type annotations - https://flow.org/en/docs/cli/annotate-exports/ Theoretically it should add type annotation are to be added only at module boundaries(which is generally what is preferred for typescript as well), and so - there should be not much noise from it, but noticeable improvement in type coverage. Yet to try using it… |
oh neat, i was about to write something that uses |
Interesting concept. Wondering if this could be something that is also interesting for flowts: https://github.com/Airtable/typescript-migration-codemod/blob/main/src/typescript/flow_type_at_pos.ts
This would add annotations, where flow knows the type so it would increase type coverage. Just bringing that up in case you are interested.
The text was updated successfully, but these errors were encountered: