Skip to main content

Advanced Usage

The Intuita 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 as Intuita's useful features that make running codemods easier.


On this page, you will learn:

Dry-running 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:

  1. Find the codemod you would like to use.
  2. Click Dry Run.

Change Codemod Path (Optional)

Before dry-running a codemod over your project, the Intuita extension allows you to limit the codemod’s changes to a specific path in your project.

This is useful for tackling large project migrations by breaking them down into smaller, manageable tasks.

tip

By default, dry-running a codemod will affect the root directory of your project. In most cases, this is fine. However, if you are migrating a large project, choosing codemod paths can be very helpful.

To change a codemod's path:

  1. Hover over the codemod.
  2. Click on Edit Path.
  3. Specify the desired path.

Set 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:

  1. Click on the Edit Codemod Arguments icon.
  2. Set the value of the available arguments.

Reviewing and Applying Changes

The is reviewing the changes made by the codemod.

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.

    Selecting a dry run will show a diff view containing the changes made by the codemod.

  2. Accept or decline specific 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.

  3. Set changes as reviewed.

  4. Apply changes.

    When you click Apply, the Intuita extension will apply the selected changes to your local project files.

More Helpful Features

Change Explorer

You can use the change explorer to easily browse the affected files. The Change Explorer is especially helpful when you are reviewing a lot of changes.

Additionally, you can use the change explorer's search to look for specific files.

Diff View Switch

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.

Report codemod issue

tip

If you’re interested in writing your own codemods, here are some great resources:

You can also join and collaborate with our community of codemod experts on Slack →