Back
🔷
JS to TypeScript Migration Checklist
Hard
16 items
·
2 hours
testuser
Published 1 month ago
A focused, practical checklist to guide teams or solo devs through migrating a JavaScript codebase to TypeScript. Covers tsconfig setup, incremental file renames, third-party types, CI checks, and cleanup steps.
Progress
0 / 16
- Install TypeScript and initialize tsconfig.json — npm i -D typescript; run npx tsc --init to create a starter tsconfig.json.
- Configure tsconfig and review strict settings — Start with a strict baseline and plan which flags to enable now vs later.
- Set 'strict': true in tsconfig.json — Enable the umbrella strict flag to opt into multiple safety checks.
- Enable noImplicitAny and strictNullChecks — Turn on noImplicitAny and strictNullChecks, then list hotspots to fix.
- Enable allowJs and checkJs for gradual migration — Set allowJs: true and optionally checkJs: true to type existing JS files incrementally.
- Rename .js/.jsx files to .ts/.tsx in small batches — Use feature branches and small PRs to minimize reviewer overhead and conflicts.
- Install @types packages or typed alternatives for dependencies — npm i -D @types/pkg or switch to packages that bundle types to avoid missing types.
- Add custom declaration files for untyped modules — Create src/types.d.ts or a types/ folder and declare module 'untyped-lib' as needed.
- Address noImplicitAny hotspots with explicit types — Add parameter/return types, interfaces, or temporary any annotations sparingly.
- Refactor common shapes using utility types and generics — Use Partial, Pick, Omit, ReturnType and generics to reduce duplication.
- Update bundler and build configs for .ts/.tsx — Configure ts-loader, babel-preset-typescript, or relevant plugins to compile TS.
- Add TypeScript type checking step to CI — Add npx tsc --noEmit (or yarn tsc --noEmit) to CI to fail on type errors.
- Update test runner setup and rename tests to .ts/.tsx — Configure ts-jest or babel-jest and update test configs to handle TypeScript.
- Enable incremental compilation and set tsBuildInfoFile — Turn on incremental:true and specify a tsbuildinfo file to speed subsequent builds.
- Configure ESLint for TypeScript and run autofix — Install @typescript-eslint/parser and plugin, lint and autofix to catch style/type issues.
- Remove allowJs and tighten tsconfig once codebase is typed — Run a full type check, remove allowJs, and re-enable strict flags as final cleanup.
Your Stats
🏆
0
Completed
📅
—
Last Done
⏱️
—
Last Time
Completion Rate
Items checked per run
⚡
—
Fastest Run
🔥
0
Streak
🚫
—
Most Skipped Step
🔄
0
Resets
📝 My Notes