Migration
Advanced

Migration, Refactoring, and Any Budgets

Move JavaScript and weak TypeScript code toward strict, maintainable enterprise TypeScript.

42 min
3 sections
migration
refactoring
any
technical-debt
1
2
3

01. Migration Strategy

Section 1 of 3

A safe migration is incremental. Start by protecting boundaries, then core domain models, then shared components, then stricter compiler flags. Do not try to fix every type at once in a large codebase.

typescript
type MigrationSlice = {
  area: "api-boundary" | "domain" | "ui" | "tests";
  owner: string;
  currentAnyCount: number;
  targetAnyCount: number;
  strictFlagsEnabled: readonly string[];
};

const slice: MigrationSlice = {
  area: "api-boundary",
  owner: "platform-api",
  currentAnyCount: 42,
  targetAnyCount: 10,
  strictFlagsEnabled: ["strictNullChecks", "noImplicitAny"],
};
Back to Course