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
2 recasts
192 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
Fucory
@fucory
If you built a codemod already using any tool nad it works you are already done though. Codemods aren't usually thing you actually maintain and change you just throw some ugly code that works over the wall and move on generally
0 reply
0 recast
0 reaction