Content
@
0 reply
0 recast
0 reaction
Kevin
@typedarray.eth
What's the best codemod tool/script you've ever used? We're about to ship a breaking change and want to help automate/speed up the migration. Curious for prior art wrt distribution - npx, code snippet, etc. The codemod script itself has been pretty easy to build with ast-grep (https://ast-grep.github.io/).
2 replies
39 recasts
197 reactions
Ryan
@ryansmith
I feel like Go popularized this kind of thing with gofmt. It also has rewrite and refactor programs. Good stuff https://pkg.go.dev/golang.org/x/tools
1 reply
0 recast
6 reactions
Fucory
@fucory
It really depends on use case Babel is honestly by far my favorite to use You will want to use typescript if you need type information There are tools like jscodeshift and others that are good if you plan on maintaining code mods long term or creating many more in future There are light weight tools all the way down to just using a regex that can be best depending on how simple the changes are
1 reply
0 recast
1 reaction