DEV Community

Cover image for Why Your TypeScript 7 Upgrade Broke ESLint, ts-jest, and ts-morph
Dev Encyclopedia
Dev Encyclopedia

Posted on

Why Your TypeScript 7 Upgrade Broke ESLint, ts-jest, and ts-morph

You installed TypeScript 7, ran your build, and something broke. Maybe ESLint crashed with a cryptic TypeError: Cannot read properties of undefined (reading 'Cjs'). Maybe ts-jest stopped transforming your test files. Maybe your CI pipeline just went red for no reason you can point to.

You're not doing anything wrong.

TypeScript 7 shipped tsgo, a genuine Go port of the type-checker, not a rewrite from scratch. But the tools that plug into TypeScript don't talk to the type-checker directly, they talk to a programmatic API. That API isn't stable yet, it lands in 7.1. Until then, a chunk of the ecosystem throws errors the moment you point typescript at the new version.

The 10-second version

Don't replace typescript in your dependencies with the 7.x line if you use typescript-eslint, ts-jest, ts-morph, or any tool doing programmatic type-checking. Keep typescript pinned to 6.x for those tools, and install @typescript/native-preview alongside it purely for fast type-checking in CI or a manual tsgo --noEmit command. Two compilers, living side by side, each doing a different job.

Why this is happening

The TypeScript team calls this Project Corsa: a line-by-line port of the compiler from the old JavaScript codebase (Strada) into Go (Corsa), preserving identical type-checking behavior while getting roughly 10x faster builds from real OS threads instead of Node's single-threaded event loop.

That preservation is impressive, but it's a port, not a reimplementation with a new API surface. Tools like typescript-eslint depend on the programmatic API to walk your AST and pull type information out of the compiler, and that API isn't ready until 7.1.

What's actually broken right now

typescript-eslint — npm refuses to install alongside typescript@7 at all (ERESOLVE error), because the published peer range only allows versions below 6.1.0. Force it through and ESLint crashes deep inside typescript-estree. Tracked as typescript-eslint issue #12518, closed as not planned since the real fix is on TypeScript's side.

ts-jest — Fine if typescript stays on 6.x in node_modules. Point ts-jest itself at @typescript/native-preview and it breaks, because it calls internal Strada APIs Corsa doesn't expose yet. Shows up as confusing transform failures, not install failures.

ts-morph and custom AST transformers — Same story: deep programmatic type introspection needs the 7.1 API. These tend to fail silently or produce subtly wrong output rather than crash outright, so audit before upgrading.

Monorepos with project references — The roughest edge. tsgo drops generic type parameters from JSDoc @typedef declarations using @template, and skipLibCheck: true doesn't suppress certain parse-level errors from third-party .d.ts files. A compatibility survey of 15 pipeline tools found 9 call Strada API functions that no longer exist.

The side-by-side fix

npm install -D typescript@^6.9
npm install -D @typescript/native-preview
Enter fullscreen mode Exit fullscreen mode
{
  "scripts": {
    "typecheck:fast": "tsgo --noEmit",
    "build": "tsc"
  }
}
Enter fullscreen mode Exit fullscreen mode

Run typecheck:fast as an early CI step, before your slower full build, and leave typescript-eslint's config untouched so it keeps resolving against your pinned 6.x install.

When to cut over

Wait for 7.1's stable programmatic API before dropping the side-by-side setup. If you're not using typescript-eslint, ts-morph, or custom transformers, and just run tsc for type-checking and emit, you can move to 7.0 as soon as it hits general availability. Most codebases aren't that lucky.

Full breakdown with the tool compatibility matrix, tsconfig defaults that changed, and an ERESOLVE fix generator: 👉 Why Your TypeScript 7 Upgrade Broke ESLint, ts-jest, and ts-morph

Top comments (0)