Khan / flow-to-ts

Convert flow code to typescript
https://flow-to-ts.netlify.com
393 stars 75 forks source link

Support jscodeshift codemods #175

Open gomesalexandre opened 4 years ago

gomesalexandre commented 4 years ago

jscodeshift is the industry standard for writing codemods (it uses recast under the hood and abstracts it, as opposed to this project using @babel/parser.

Adding support for codemods would allow for the community to quickly contribute codemods to make this closer to 100% conversion.

It could simply be a new step after the initial conversion with @babel/parser.

kevinbarabash commented 3 years ago

Interesting idea. It seems like certain things like handling the conversion of React and utility types might be a good fit for this. Converting syntax would be hard.

kevinbarabash commented 3 years ago

I worry a little bit about performance implications of running multiple jscodeshift passes on the code. I guess if things are two slow the codemods can be rewritten within the core conversion pass.