Toollenss
Case study約 12 分

Migrating an 8-year-old codebase to TypeScript: 9 traps

A big-bang migration is a trap. What saves time is letting the model read the dependency graph, then converting module by module.

Tests first, types second

A refactor without tests is a gamble. At minimum, cover the entry points and the core data flow with integration tests so the model can run them after every change.

Make the model draw the dependency graph first

Before touching code, have it list who imports the target module and what the module imports. This surfaces 60% of the hidden coupling before you commit to a direction.

'any' is debt, not a solution

Allow 'any' during the migration, but count it in CI and set a declining target. Otherwise the cleanup never ends.

Convert along call chains, not folder trees

Folder structure is history; call chains are the real coupling. Converting along call chains keeps every single commit in a runnable state.

この記事で使うツール

実際の導入過程に基づく記事です。仕様が変わっている場合はご連絡ください。

続けて読む