A codemod to rescue you from a Immutable.js abuse.
Immutable.js is a great library that helps you to remain your JavaScript objects immutable and provides you from a lot of data structures.
Probably, in a bunch scenarios Immutable.js is your library.
But sometimes you can get your code tightly coupled to this library, you are doing an abuse of it, or maybe your project needs may have changed, so you are no interested in use it anymore.
Is time to erase it 🔥
So this the main goal of this repository is provide you with a collection of codemod scripts for use with JSCodeshift and other utils that help you to achieve this.
We recommend that before use this tool ensure that you have a backup (for example, if you don't have the source code versioned with tools like git :D)
npm install
if you are working with yarn, use yarn
instead of npm
and npx
npx jscodeshift path_to_the_code_you_want_to_transform -t jscodeshift_transformer_file
In order to ensure that you are executing correctly the code of the example be sure that you are in the root directory of immutablejs-eraser-codemod package :)
npm install --prefix examples/get-to-js-bracket-notation
npx jscodeshift examples/get-to-js-bracket-notation/**.js -t transforms/getToStandardJSApi.js
Transform any Immutable.js getter get
to the standard JavaScript way to access to object props.
Mario Sánchez 💻 📖 👀 |
Alberto Delgado Roda 📖 💡 |
---|