Skip to content

robBowes/migrate-ts

 
 

Repository files navigation

migrate-ts

A modified version of ts-migrate designed to work in the zola projects.

To use:

Run the script

npx migrate-ts <filename or glob> [flags]

Flags

--ignore: ignore all ts errors using ts-expect-error comments

--reignore: remove all ts-ignore and ts-expect-error comments

--rename: rename js and jsx files to ts/tsx

Examples:

Migrate a single javascript file

 npx ts-migrate ./src/pages/LegacyComponent.jsx --rename

Migrate a folder of js files

npx ts-migrate ./src/pages/*.jsx --rename

Migrate a folder of js files and add ignore comments

npx ts-migrate ./src/pages/*.jsx --rename --ignore

Migrate a single ts file and re-add ignore comments

npx ts-migrate ./src/pages/tsFile.ts --ignore --reignore

License

MIT, see LICENSE for details.

About

A tool to help migrate JavaScript code quickly and conveniently to TypeScript

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 97.2%
  • JavaScript 2.8%