Open hoschi opened 7 years ago
Use Babylon as parser so we get TypeScript support when https://github.com/benjamn/recast/issues/424 has landed. Use ast-types
instead of @babel/types
so we are flexibel in the the parser department. ast-types
has a broader support than @babel/types
as explained here:
https://github.com/benjamn/recast/issues/424#issuecomment-363112376
TS support is in latest recast.
Parser configurations: https://github.com/benjamn/recast/tree/master/parsers
Babylon has neat things in my opinion:
I'm not sure with TypeScript support in Babylon means it works in Recast, see Recast ticket here.
Also I could not say with the documentation I found if nodes have more methods like babel provides. Things I saw like this example https://github.com/hoschi/babel-plugin-react-intl/blob/master/src/index.js#L269 Where you can gather the "binding" of a function call to find the module which this function was imported from.