jscodeshift-typescript-example is a project with jscodeshift example codemods for TypeScript.
jscodeshift codemods are found in the src/ folder, along with unit tests and codemod prompt description files
- Use
npmas dependency manager - Use Vitest for unit testing
- Install deps:
npm install - Run tests:
npm test - Run single test:
npm test src/simple-rename.spec.ts
- Spaces for indentation (2 spaces)
- Single quotes, semicolons, trailing commas
- Use descriptive variable/function names
- Use Vitest for unit testing
- Test files:
*.spec.ts
- add console.log statements to debug the AST
- remove console.log when debugging is done
- ALWAYS remove temporary and debug files before committing
- ALWAYS run
npm testbefore committing - NEVER use
git push --forceon the main branch - Use
git push --force-with-leasefor feature branches if needed - Use conventional commits style for git commit messages
- Use conventional commits style to describe GitHub PR titles