Use Recast for AST modification in custom.js#4
Conversation
Most of the changes here are just reindentation, as you can see from `git show -w`.
|
+1 on this. From recast README:
So this means that in a lot of cases envify won't change formatting and line numbers! |
|
Ah, fantastic - a few of my transforms have been using escodegen and the reformatting can be pretty frustrating. I'll have a proper look at the changes after work and then it should be good to merge :) It'll probably warrant bumping envify up to 1.0.0 too. Thanks @benjamn! |
|
Glad you like it! Whatever you decide here, I'm curious to know how |
Use Recast for AST modification in custom.js
|
Looks great, merging and publishing to 1.0.0. Thanks again :) |
This version uses Recast for source transformation: hughsk/envify#4
This version uses Recast for source transformation: hughsk/envify#4
The https://github.com/benjamn/recast package is similar in spirit to
falafel, but it has more convenient tools for checking AST node types and creating new AST nodes, which helps simplify the bigif-statement incustom.jsand also makes it easier to create the replacementLiteralnodes.If that's not something you particularly care about, then feel free to close this pull request. Just thought I'd make the suggestion!