1.0.0 • Published 2 years ago

@sharpinit/codemod v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

codemod

This repository contains a collection of codemod scripts based for use with jscodeshift that help update MUI APIs.

Setup & run

npx @sharpinit/codemod <codemod> <paths...>

Applies a `@sharpinit/codemod` to the specified paths

Positionals:
  codemod  The name of the codemod                                [string]
  paths    Paths forwarded to `jscodeshift`                       [string]

Options:
  --version  Show version number                                 [boolean]
  --help     Show help                                           [boolean]
  --dry      dry run (no changes are made to files)
                                                [boolean] [default: false]
  --parser   which parser for jscodeshift to use.
                                                [string] [default: 'tsx']
  --print    print transformed files to stdout, useful for development
                                                [boolean] [default: false]
  --jscodeshift                                  [string] [default: false]

Examples:
  npx @sharpinit/codemod direct-import src --jscodeshift="--modules=@mui/icons-material"

jscodeshift options

To pass more options directly to jscodeshift, use --jscodeshift="...". For example:

npx @sharpinit/codemod --jscodeshift="--run-in-band --verbose=2"

See all available options here.

Recast Options

Options to recast's printer can be provided through jscodeshift's printOptions command line argument

npx @sharpinit/codemod <transform> <path> --jscodeshift="--printOptions='{\"quote\":\"double\"}'"

Inspired by:

1.0.0

2 years ago

1.0.0-beta.0

2 years ago

0.0.3-beta.0

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago