- TypeScript all the way 🚀
- TypeScript transformer
- Vibe Code Your
jscodeshift
Codemod 🤖 - Installation
- Run a codemod
- Test
- Debug
- Behind the scenes
- Resources & Inspiration
- Awesome lists
Example usage of jscodeshift for TypeScript with TypeScript:
- TypeScript target files *.ts
- TypeScript transformer
- TypeScript test files
- TypeScript fixtures
Strongly typed code and code completion with @types/jscodeshift
With .github/copilot-instructions.md
and .github/prompts/new-transformer.prompt.md
you can vibe code your jscodeshift codemod.
Example prompt to create a new transform with tests:
Create a new transform to add a post-fix "funny" to class name
before:
```ts
class Foo {}
```
after:
```ts
class FooFunny {}
```
npm i
npx jscodeshift -t ./src/simple-rename.ts --extensions=ts --parser=ts **/*.ts --print --dry
Omit
--dry
to write the transformed source back to disk.
npm test
Use the pre-configured VSCode launcher to run tests and debug your transformer.
Use @typescript-eslint/parser
in https://astexplorer.net when working with the jscodeshift's parser="ts"
By default jscodeshift will use the babel
parser (@babel/parser
)