This repository is an use case set up for the article:
It shows how to work with jscodeshift.
You can find:
src/HelloWorld.js
: Source filecodemod/transform.js
: Codemod
yarn
# or
npm install
Transform the code runing:
npx jscodeshift -t codemod/transform.js src/HelloWorld.js
-t codemod/refactor.js
is for the path to the transformation file.src/HelloWorld.js
is the file we want to transform (you can use)
Tada, your file has been transformed 🎉