/jscodeshift-examples

Primary LanguageJavaScriptMIT LicenseMIT

jscodeshift-examples

license

Maintenance Status Build Status Renovate enabled Tested with jest Dependencies status Dev Dependencies status PRs Welcome

Watch on GitHub Star on GitHub

A few examples on jscodeshift codemods with tests.

Table of Contents

Quick Usage

Running

npm start

Run npm start to start an interactive CLI where you will be prompted for:

  • the codemod/transform to run
  • the input file to transform
  • options to be passed to the codemod/transform

that will be run via jscodeshift.

Linting and Type-Checking

npm run lint

Run npm run lint to type-check .ts files and run linting across .js and .ts files via eslint.

Unit Testing

npm test

Run npm test to do a one-time pass of Jest unit tests with coverage.

Developing

npm run jest:projects

Run npm run jest:projects to do a one-time pass of ESLint linting, and Jest unit tests with coverage.

When developing, run npm run jest:projects:watch which will validate ESLint linting and Jest unit tests as you develop and change code.

Supported Node Versions

The repository has been tested to work in Node 12.

Technologies Used

References

jscodeshift

License

The repository is available as open source under the terms of the MIT License.