News for hackers. Stuff that matters.
Re:Codemod – A library to assist with large-scale codebase r... by stringham on Wednesday August 23, 2017 @09:24PM (#15086885)
I find the idea of https://github.com/facebook/jscodeshift to be really useful.

I've started writing small scripts using the TypeScript parser as a library to make meaningful improvements in our codebase. Since JavaScript is valid TypeScript syntax the scripts work on both.

For example, I wrote a small script to change var to let or const when possible. It uses the AST to check scoping rules and to check if a variable is ever reassigned.

Writing scripts like this is way more effective than doing it by hand.

There are no comments on this comment yet.