mts-migrator

JSON →
library 2.1.11 ·javascript
verified Jun 7, 2026

mts-migrator is a javascript-to-typescript migration engine that converts CommonJS modules to ESM, infers types from AST analysis, extracts JSDoc annotations, and refines types with the TypeScript compiler using ts-morph. Current stable version is 2.1.11, released under AGPL-3.0. It can be used via `pnpm dlx` or `npx` without installation. Key differentiators: it handles module system conversion (require→import, module.exports→export), deduplicates imports, strips .js/.jsx from relative imports, infers types from literals, constructors, known APIs, arrays, binary ops, and JSDoc, and optionally runs eslint --fix. It backs up original files, supports dry runs, error recovery, migration reports, and skips config files. Does not handle Flow types or fix logic bugs.