flow-to-typescript
flow-to-typescript copied to clipboard
Clean up of #12
Cleaned up some of the comments from @bcherny on @benjie's #12
- [x] There's some issues still with the types that I'm hoping to solve by adding the
@types/babel__traversepackage. - [ ] There's also one test error:
TypeError: Property body of DeclareClass expected node to be of a type ["ObjectTypeAnnotation"] but instead got "TSTypeLiteral"
Any ideas?
My guess is DeclareClass is a Flow type (which expects only Flow types as children), while TSTypeLiteral is a TS type. This might be a limitation of the walker approach in this PR, as opposed to a recursive descent approach to transforming the tree from Flow -> TS.
I had to work around the types quite a lot to make it work correctly; hence the ts-ignores/etc everywhere. I think some of it was down to mismatched versions, was planning to upgrade all the dependencies and try again but still have yet to find time.