Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chimurai/jscodeshift-typescript-example
jscodeshift typescript codemod example
https://github.com/chimurai/jscodeshift-typescript-example
codemod debug jest jscodeshift typescript vscode
Last synced: 4 days ago
JSON representation
jscodeshift typescript codemod example
- Host: GitHub
- URL: https://github.com/chimurai/jscodeshift-typescript-example
- Owner: chimurai
- License: mit
- Created: 2020-12-06T19:06:20.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-10-28T03:39:01.000Z (7 days ago)
- Last Synced: 2024-10-28T07:11:25.006Z (7 days ago)
- Topics: codemod, debug, jest, jscodeshift, typescript, vscode
- Language: JavaScript
- Homepage:
- Size: 6.96 MB
- Stars: 75
- Watchers: 3
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jscodeshift-typescript-example
## TypeScript all the way 🚀
Example usage of [jscodeshift](https://github.com/facebook/jscodeshift) _for_ TypeScript _with_ TypeScript:
- TypeScript target files *.ts
- TypeScript transformer
- TypeScript test files
- TypeScript fixtures## TypeScript transformer
Strongly typed code and code completion with `@types/jscodeshift`
![code-completion](https://raw.githubusercontent.com/chimurai/jscodeshift-typescript-example/main/docs/code-completion.gif)
## Installation
```shell
npm i
```or
```shell
yarn
```## Run codemod
```shell
npx jscodeshift -t ./examples/simple-rename.ts --extensions=ts --parser=ts './**/*.ts' --print --dry
```> _Omit `--dry` to write the transformed source back to disk._
## Test
```shell
npm test
```or
```shell
yarn test
```## Debug
Use the [pre-configured VSCode launcher](https://github.com/chimurai/jscodeshift-typescript-example/blob/main/.vscode/launch.json) to run tests and debug your transformer.
![debugger](https://raw.githubusercontent.com/chimurai/jscodeshift-typescript-example/main/docs/debugger.gif)
## Behind the scenes
Use `@babel/parser` in [https://astexplorer.net](https://astexplorer.net) when working with the jscodeshift's [default parser](https://github.com/facebook/jscodeshift#usage-cli) (default: `babel`).
## Resources & Inspiration
-
-
-
-## Awesome lists
-
-