flow-to-typescript icon indicating copy to clipboard operation
flow-to-typescript copied to clipboard

Clean up of #12

Open BBB opened this issue 7 years ago • 2 comments

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__traverse package.
  • [ ] 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?

BBB avatar Feb 28 '19 16:02 BBB

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.

bcherny avatar Mar 02 '19 21:03 bcherny

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.

benjie avatar Mar 02 '19 21:03 benjie