Get started with using Codemod VS Code extension.
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.
You can install Codemod VS Code extension from the VS Code marketplace here.
Dry-run codemods
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:
Dry Run
.Running the codemod over a specific directory
Change 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:
Edit Codemod Arguments
icon.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 run
2. Review and accept/decline file changes
Sometimes 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.
3. Apply changes
Switch diff view
You can switch between an inline or side-by-side diff view by clicking the view type toggle.
Reporting issues
If a codemod causes an incorrect change, you can report an issue by clicking Report Issue.