- Extract strings from react components (required during i18n and testing)
- Find states that can be colocated inside components (improves performance) (Coming Soon!)
npx github:xerosanyam/codemod
npx github:xerosanyam/codemod <file or dir to apply on> <transformer name>
npx github:xerosanyam/codemod fixtures extract-strings
- extract-strings
- ...
- wrong output? please remove any
babel.config.js
files temporarily & re-try to avoid any parsing problems.
- https://github.com/reactjs/react-codemod
- https://github.com/janczizikow/sjt/blob/main/cli.js
- https://egghead.io/blog/codemods-with-babel-plugins
-
Using inquirer
node index.mjs --force
-
Specific transformer
node index.mjs extract-strings fixtures/ --force
-
Run on folder
jscodeshift --verbose=2 --extensions=tsx,ts,jsx,js --transform /Users/sanyamjain/dev/xerosanyam/codemod/transformer/extract-strings.js fixtures