🔮 Sanity Create is here. Writing is reinvented. Try now, no developer setup


Runs a code modification script

usage: sanity codemod [CODEMOD_NAME]

   Runs a code modification script

Runs a given code modification script on the current studio folder.
Running the command without a specified codemod name will list available transformations.

  --dry Dry run (no changes are made to files)
  --extensions=EXT Transform files with these file extensions (comma separated list)
                   (default: js,ts,tsx)
  --no-verify Skips verification steps before running codemod

  # Show available code mods
  sanity codemod

  # Run codemod to transform react-icons imports from v2 style to v3 style,
  # but only as a dry-run (do not write the files)
  sanity codemod reactIconsV3 --dry

Was this article helpful?