---
title: "Migrating a Large Flow Monorepo to TypeScript"
description: "Yelp migrated 1.4 million lines of Flow-typed JavaScript in a Lerna monorepo to TypeScript over three and a half years, converting one package at a time without ever bulk-disabling typechecking."
url: "https://swe.quest/articles/migrating-a-large-flow-monorepo-to-typescript-750b673839e64549"
canonical: "https://engineeringblog.yelp.com/2026/08/migrating-a-large-flow-monorepo-to-typescript.html"
source: "Yelp Engineering"
published: "2026-08-04"
difficulty: "medium"
kind: "Case study"
reading_minutes: 11
tags: ["typescript","refactoring","javascript","type-systems","build-systems"]
---

# Migrating a Large Flow Monorepo to TypeScript

A post on [Yelp Engineering](https://swe.quest/sources/yelp.md), published 2026-08-04, 11 min read, Case study. Original: [https://engineeringblog.yelp.com/2026/08/migrating-a-large-flow-monorepo-to-typescript.html](https://engineeringblog.yelp.com/2026/08/migrating-a-large-flow-monorepo-to-typescript.html)

## Summary

Yelp migrated 1.4 million lines of Flow-typed JavaScript in a Lerna monorepo to TypeScript over three and a half years, converting one package at a time without ever bulk-disabling typechecking. Packages were converted bottom-up with flowts (later Stripe's flow-to-typescript-codemod), and flowgen turned the generated .d.ts files back into Flow headers so unconverted Flow code still typechecked against them. A dependency-graph importance score, Graphviz visualizations, auto-filed Jira tickets and quarterly deadlines kept the long tail moving. The result was 96.44% type coverage versus 83.15% under Flow, about 6,000 @ts-expect-error directives, and 82% of surveyed engineers reporting higher productivity. Early-2023 LLMs and cron-driven auto-conversion did not prove reliable enough to use.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [TypeScript](https://swe.quest/tags/typescript.md) (Languages)
- [Refactoring & migrations](https://swe.quest/tags/refactoring.md) (Engineering practices)
- [JavaScript](https://swe.quest/tags/javascript.md) (Languages)
- [Type systems](https://swe.quest/tags/type-systems.md) (Compilers & runtimes)
- [Build systems](https://swe.quest/tags/build-systems.md) (Engineering practices)

## Prerequisites

- Flow and TypeScript type checking ([easy posts on TypeScript](https://swe.quest/tags/typescript.md?difficulty=easy))
- JavaScript monorepos ([easy posts on JavaScript](https://swe.quest/tags/javascript.md?difficulty=easy))
- Babel and Webpack builds

## Keywords

TypeScript, Flow, flowgen, flowts, flow-to-typescript-codemod, Lerna, Babel, Webpack

## Related posts

- [Migrating from Apollo Tooling to GraphQL Codegen at Yelp](https://swe.quest/articles/migrating-from-apollo-tooling-to-graphql-codegen-at-yelp-732b107d437979cc.md): Yelp Engineering · 2026-07-16 · Medium · 11 min read · GraphQL, TypeScript, Build systems, Refactoring & migrations, Open source
  Yelp replaced the deprecated apollo-tooling codegen with GraphQL Codegen across a 500+ package React/TypeScript monorepo without requiring developers to change imports or queries.
- [The evolution of Figma’s mobile engine: Compiling away our custom programming language](https://swe.quest/articles/the-evolution-of-figma-s-mobile-engine-compiling-away-our-custom-programming-4555b49211ef8f02.md): Figma · 2024-05-01 · Medium · 16 min read · Refactoring & migrations, TypeScript, Compilers, Performance engineering, JavaScript
  Figma migrated its prototype viewer's mobile engine from Skew, an in-house compile-to-JavaScript language, to TypeScript using a custom Skew-to-TypeScript transpiler and a three-phase rollout (write/build Skew, write Skew/build TypeScript, write/build TypeScript) that never paused development.
- [How to Write Code Without Having to Read It](https://swe.quest/articles/how-to-write-code-without-having-to-read-it-1700fbc56278687d.md): Shopify Engineering · 2022-10-11 · Medium · 12 min read · Type systems, Testing, Refactoring & migrations, TypeScript, Developer productivity
  Engineers can safely change unfamiliar code with minimal reading by letting the compiler, linter and unit tests guide them: locate the entrypoint via user-visible strings (or git bisect for regressions), make the breaking change at the leaf component, then climb the callstack following build errors and sweep back down via lint errors, exhaustive switches and test failures.
- [From Ruby to Node: Overhauling Shopify’s CLI for a Better Developer Experience](https://swe.quest/articles/from-ruby-to-node-overhauling-shopify-s-cli-for-a-better-developer-experience-c31f4bbd707f942e.md): Shopify Engineering · 2023-01-10 · Medium · 12 min read · Developer tools, TypeScript, JavaScript, Refactoring & migrations, Testing
  Shopify rewrote its CLI from Ruby to TypeScript on Node to reduce system requirements, unify the Theme, App and Hydrogen workflows, and stay easy for internal teams to contribute to.
- [How we use Web Components at GitHub](https://swe.quest/articles/how-we-use-web-components-at-github-43357e36de1ecc50.md): GitHub Engineering · 2021-05-04 · Medium · 8 min read · Frontend, Browsers, Design systems, TypeScript, Refactoring & migrations
  GitHub moved from jQuery to native Web Components starting in 2014 and now ships dozens of custom elements such as \<include-fragment\>, \<details-dialog\> and \<relative-time\>.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
