note

jscodeshift

The jscodeshift is an interesting piece of work.

It is a transformation runner, it enables to write automated code upgrade tools.

Facebook uses it in order to upgrade the React application to follow the API versions.

Example

To automate the upgrade of your createComponent based React components:

npm i -g jscodeshift
git clone https://github.com/reactjs/react-codemod.git
cd react-codemod
npm i

Then to perform a transformation on your code:

jscodeshift -t react-codemod/transforms/class.js path/to/components

This will "magically" upgrade you React component to a ES2016 class React upgrade guidelines.

About me

Stuff I do with my brain, my fingers and an editor:

(Front-end) development - typescript, Vue, React, svelte(kit) web architectures web performance API design pragmatic SEO security Accessibility (A11y) front-end dev recruitment and probably more...

Feel free to , check out my open source projects, or just read the things I write on this site.