ESC

Type to search the knowledge base.

TypeScript Adoption Path

Practical TypeScript adoption path for FE teams and individuals — strict mode, UI state types, React, migrations, and interviews.

intermediate4 min read
  • roadmaps
  • typescript-adoption

TypeScript pays off when it models your domain and fails closed at boundaries. This path works for individuals leveling up and teams migrating JS → TS.

Interview map: TypeScript interview questions. Intro: TS for JS engineers.

Stage 0 — Prerequisites

Stage 1 — Compiler & basic types

Goals: Read errors; annotate without noise.

Checkpoint: New file in strict mode; zero any.

Stage 2 — Narrowing discipline

Checkpoint: Refactor boolean soup UI state into a discriminated union.

Stage 3 — Generics & reuse

Checkpoint: Generic List<T> component or api.get<T>() helper.

Stage 4 — Everyday utility patterns

Checkpoint: Form values typed; submit handler exhaustiveness for status.

Stage 5 — React + TypeScript

Checkpoint: Migrate one feature folder to TS with typed props throughout.

Stage 6 — Runtime boundaries

Goals: Types lie across the network — validate.

Checkpoint: Zod (or similar) schema for a real endpoint; UI consumes inferred type.

Stage 7 — Tooling & repo adoption

Team checkpoint: tsc -b (or project references) green on main; policy for new files = TS.

Stage 8 — Migration playbook (teams)

1. Strict tooling on new code
2. Leave JS, JSDoc optional
3. Convert leaf utils → components → pages
4. Kill `any` with eslint
5. Boundary schemas last mile

Write an RFC: goals, non-goals, timeline, escape hatches.

Stage 9 — Interview polish

Anti-patterns during adoption

Anti-pattern Better
Blanket as any Fix the model or validate at boundary
Disabling strict for “speed” Strict on new packages first
One giant types.ts junk drawer Colocate types with features
Duplicating API types by hand forever Generate or share schemas carefully
Typing tests last Type production paths first

Individual 4-week sprint

Week Goal
1 Strict playground + narrowing drills
2 Discriminated UI state in a small app
3 Generic list/fetch helpers + React props
4 Schema at API boundary; remove remaining any

Log every any you introduce and delete it within 48 hours — builds the right reflex.

Team communication tips

  • Show a before/after bug caught by types in the RFC
  • Measure PR review time; TS should not become bikeshed theater
  • Provide cheat sheets for common React event types
  • Pair convert the thorniest module once publicly

What to skip early

  • Publishing complex conditional types for one use
  • any to “finish faster” in learning projects
  • Converting CSS and configs before app code
  • Perfect open-source-level types for internal throwaway scripts

Further reading

Adoption succeeds when errors prevent bugs your users feel — not when the type-level score is maximal.