https://github.com/joris-gallot/typestep
Simplifies JavaScript to TypeScript migration with incremental changes
https://github.com/joris-gallot/typestep
incremental-migration migration tsc types typescript
Last synced: 3 months ago
JSON representation
Simplifies JavaScript to TypeScript migration with incremental changes
- Host: GitHub
- URL: https://github.com/joris-gallot/typestep
- Owner: joris-gallot
- License: mit
- Created: 2024-05-04T15:57:53.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2026-01-20T21:29:08.000Z (5 months ago)
- Last Synced: 2026-01-21T07:06:09.471Z (5 months ago)
- Topics: incremental-migration, migration, tsc, types, typescript
- Language: TypeScript
- Homepage:
- Size: 493 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Typestep
Typestep aims to simplify the migration process from JavaScript to TypeScript in existing projects by offering a gradual transition strategy. It allows developers to introduce TypeScript incrementally by leveraging the parsing of TypeScript compiler output (tsc)
## Usage
```bash
npm install typestep --save-dev
```
> [!WARNING]
> Do Not Use `--pretty` option with `tsc`
```bash
tsc --noEmit > tsc-output.log
```
### Config file
#### Init config file
The `typestep init` command creates your Typestep config file by analyzing the tsc output, for each file that has TypeScript errors, it will automatically generate a configuration that ignores the specific error codes found in that file. This allows for a granular approach to TypeScript migration, where you can selectively ignore certain types of errors while addressing others.
```bash
typestep init tsc-output.log
```
#### Or create your config file
```ts
// typestep.config.ts
import type { TypestepConfig } from 'typestep'
export default {
ignoredFiles: {
'src/foo.ts': true, // ignore all errors
'src/bar.ts': {
ignoredTsErrorCodes: ['TS2339', 'TS2345'] // ignore only ts error codes
}
},
ignoredTsErrorCodes: [ // global ts error codes to ignore
'TS2322'
],
fullOutputErrors: false, // get full output errors (default: false)
} satisfies TypestepConfig
```
### Run typestep
The `typestep run` command analyzes the tsc output file and compares it with your Typestep configuration. It shows you:
- TypeScript errors that need to be fixed in non-ignored files
- Files and error codes that can be removed from the configuration as their corresponding errors no longer exist
```bash
typestep run tsc-output.log
```
## License
MIT