cheton
released this
14 Jun 04:29
·
70 commits
to v2
since this release
What's Changed
- feat(codemod): add
--extensions
,--ignore-pattern
, and--verbose
as configurable command-line options by @cheton in #877
Usage
In @tonic-ui/codemod
v2.1.0, the default file extension is now .js
, changing from the previous defaults of .js,.jsx,.ts,.tsx,.json
. You must manually specify the extension if needed.
$ npx @tonic-ui/codemod@latest react/v2.0.0/import-react-icons --help
npx @tonic-ui/codemod <codemod> <paths...>
Applies a `@tonic-ui/codemod` to the specified paths
Positionals:
codemod The name of the codemod to apply [string]
paths The paths to the codebase that will be 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]
--extensions transform files with these file extensions (comma separated
list) [string] [default: "js"]
--ignore-pattern ignore files that match a provided glob expression
[string] [default: "**/node_modules/**"]
--parser the parser to use for parsing the source files
(--parser=babel|babylon|flow|ts|tsx)
[string] [default: "babel"]
--print print transformed files to stdout, useful for development
[boolean] [default: false]
--verbose show more information about the transform process
(--verbose=0|1|2) [number] [default: 0]
--jscodeshift pass options directly to jscodeshift
[string] [default: false]
Examples:
npx @tonic-ui/codemod react/v2.0.0/import-react-icons src
For JavaScript files:
npx @tonic-ui/codemod@latest react/v2.0.0/import-react-icons . --extensions=js,jsx --verbose=2
For TypeScript files:
npx @tonic-ui/codemod@latest react/v2.0.0/import-react-icons . --extensions=ts,tsx --parser=tsx --verbose=2
Full Changelog: https://github.com/trendmicro-frontend/tonic-ui/compare/@tonic-ui/[email protected]...@tonic-ui/[email protected]