ArnaudSpanneut / codemod-example

Codemod example for the article

Home Page:https://dev.to/arnaudspanneut/how-i-gained-4-months-of-work-on-the-migration-of-a-code-base-with-codemod-2pbn

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

codemod-example

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 file
  • codemod/transform.js: Codemod

🛠 Installation

yarn
# or
npm install

⚡️ Run

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 🎉

About

Codemod example for the article

https://dev.to/arnaudspanneut/how-i-gained-4-months-of-work-on-the-migration-of-a-code-base-with-codemod-2pbn

License:MIT License


Languages

Language:JavaScript 100.0%