Kiikurage/babel-plugin-flow-to-typescript

Flow's 'Object' should be mapped to TypeScript's 'object'

diskshima opened this issue · 2 comments

Currently Flow's Object gets mapped to Object in TypeScript which results in an error in TypeScript.

I think this is because the parser treats it as a GenericTypeAnnotation (See obj1 in this example).

I believe most people are using Object to mean object in TypeScript so the implementation should map nodes with GenericTypeAnnotation named Object to tSObjectKeyword (i.e. object).

Maybe it should be object?

@satya164 Yeah, you're right. Probably won't see primitives being used so object should be the way to go.
I've changed the title and body.
Thanks for the comment!