https://github.com/facebook/jscodeshift
Abstract Syntax Tree ast tree visualizer - https://astexplorer.net/
-
Rename function
foo()
tologPerson()
jscodeshift -t shifts/1-rename.js 1-input.js
-
Refactor
logPerson()
to receive an object instead of parametersjscodeshift -t shifts/2-refactor.js 2-input.js
-
Remove use of
console.log
jscodeshift -t shifts/3-remove.js 3-input.js
https://github.com/benjamn/ast-types/blob/master/def/core.ts