craigthompson.dev

$ cat case-studies/refactor.md

Keep the toolchain modern, one reviewed change at a time

// refactors & tooling migrations

Keep the toolchain modern, one reviewed change at a time

Tooling ages fast. Rather than letting it drift, I’ve led a steady run of repo-wide migrations: linting, packages, bundling, types, runtime and the compiler itself. Each one was scripted with a and landed as a single reviewed change, so there was never a long-lived branch or a half-migrated codebase.

Repo-wide migrations I've led9,700+ files moved across them
  1. linting
    TSLint to ESLint
    455 files
  2. ci
    Semaphore to self-hosted Buildkite
    CI as code
  3. packages
    yarn to pnpm workspaces
    619 files
  4. bundling
    Webpack to Vite
    3 front ends
  5. types
    type aliases to interfaces
    804-file codemod
  6. lint + format
    ESLint + Prettier to oxlint + oxfmt
    4,366 files
  7. runtime
    compiled JS to TypeScript run natively by Node
    3,502 files
  8. compiler
    TypeScript 5.8 to TypeScript 7
    ~10× faster typechecks
  9. e2e testing
    Cypress to Playwright
    faster, more stable CI
# in practice
  • Upgrades land across the repo in one change, so the codebase doesn’t drift into “old” and “new”.
  • Back-end services start straight from TypeScript source, with no build step in between.
  • Faster tools where it counts: one quick linter and formatter, and typechecks around 10× faster on TypeScript 7.

# terms used

Codemod
A script that rewrites source code automatically, so one change can land across thousands of files at once.

$ ls case-studies/

Search and jump