The Codemod VS Code Extension allows you to run codemods over your projects to successfully migrate your project dependencies from one version to the next. This page will walk you through running these codemods as well the useful features that make running codemods easier.
Before applying a codemod to your project, you can test it out in the dry-run mode and decide which parts of your codebase it should modify. This simplifies dependency upgrade tasks and allows you to easily review large codebase changes.To dry-run a codemod:
Find the codemod you would like to use.
Click Dry Run.
Running the codemod over a specific directory
Change the target path:
Go to the codemod you want to run.
Click on the edit icon.
Specify the target path.
Changing codemod arguments
Some codemods may require custom arguments to be set before running. This feature allows you to specify custom arguments when needed.To set codemod arguments:
Click on the Edit Codemod Arguments icon.
Set the value of the available arguments.
2
Reviewing and applying changes
When you dry-run a codemod, all the changes are temporarily in preview before being applied to your local files. This allows you to accept or discard specific changes before applying them to the project’s files.To review the changes made:1. Select a dry run2. Review and accept/decline file changesSometimes codemods may make unwanted changes to some files. In such cases, you can deselect changes to prevent them from being applied to your project.
You can use the diff view editor to manually edit the changed file before applying the changes.