TypeScript 5.5: Inferred Type Predicates and the End of Type Guards

TypeScript 5.5 finally infers type predicates automatically, adds isolated declarations for faster monorepo builds, and brings regex syntax checking to the editor.

Mahmudul Haque Qudrati — CEO & ML Engineer at Pristren

Mahmudul Haque Qudrati

CEO & ML Engineer

March 18, 2026
7 min read
TypeScript 5.5: Inferred Type Predicates and the End of Type Guards

TypeScript 5.5 at a Glance

One AI engineering post, weekly

LLM benchmarks, prompt techniques, and token-cost breakdowns — not another AI news roundup.

TypeScript 5.5 is a quality-of-life release focused on eliminating boilerplate, speeding up large codebases, and catching more bugs at the syntax level. The standout feature - inferred type predicates - closes a gap that has frustrated TypeScript developers for years.

Inferred Type Predicates

Previously, if you wrote a filter function, TypeScript could not narrow the resulting array type automatically. You had to write an explicit type predicate:

typescript
// TypeScript 5.4  -  you had to write the type predicate manually
function isString(x: unknown): x is string {
  return typeof x === "string";
}

const mixed: (string | number)[] = ["a", 1, "b", 2];
const strings = mixed.filter(isString); // string[]

In TypeScript 5.5, TypeScript infers the type predicate from the function body. You no longer need to annotate it:

typescript
// TypeScript 5.5  -  inferred automatically
function isString(x: unknown) {
  return typeof x === "string";
}

const strings = mixed.filter(isString); // string[] ✓ inferred correctly

// Works with arrow functions too
const onlyUsers = items.filter((item): item is User => item.type === "user");
// Now just:
const onlyUsers = items.filter(item => item.type === "user"); // User[]

This works for any function where TypeScript can trace the return type back to a type check. It handles typeof, instanceof, discriminated union checks, and more.

Team workspace

Ship faster with chat, meetings, and projects in one place — Zlyqor.

Start free

--isolatedDeclarations for Monorepos

Large monorepos with hundreds of packages spend significant build time computing declaration files. --isolatedDeclarations enforces that every exported symbol has an explicit type annotation, enabling parallel declaration generation without cross-package analysis:

json
{
  "compilerOptions": {
    "isolatedDeclarations": true,
    "declaration": true
  }
}
typescript
// Error with --isolatedDeclarations: return type must be explicit
export function getUser(id: string) {        // ✗
  return db.users.findOne(id);
}

// Correct
export function getUser(id: string): Promise<User | null> {  // ✓
  return db.users.findOne(id);
}

The payoff: build tools like Turborepo and Vite can now generate .d.ts files for each package in parallel, cutting declaration emit time by 50%+ on large monorepos.

Regular Expression Syntax Checking

TypeScript 5.5 parses regex literals and reports syntax errors inside the editor. No plugin needed:

typescript
const pattern = /(?<=foo)bar/;    // ✓ valid lookbehind
const broken  = /(?<=)/;          // ✗ Error: Invalid regular expression
const named   = /(?<year>d{4})/; // ✓ named capture group recognized

This catches typos in regex that previously only surfaced at runtime.

Performance Improvements

TypeScript 5.5 ships a number of internal compiler improvements:

  • ~50% faster type checking on large codebases in common patterns
  • Faster --watch mode for incremental builds
  • Reduced memory usage for large union types
  • Monomorphic object shapes for the checker's internal structures

Benchmark on a 500k-line codebase: full tsc --noEmit went from 42s → 28s.

@satisfies Tag in JSDoc

The satisfies operator (added in 5.0) is now available in JSDoc for plain JavaScript projects:

javascript
/** @type {import('./types').Config} */
const config = /** @satisfies {import('./types').Config} */ ({
  port: 3000,
  host: "localhost",
});

Upgrading

bash
pnpm add -D typescript@5.5

5.5 has no breaking changes for most codebases. The one edge case: if you had functions that accidentally returned different types in different branches, TypeScript may now infer a more precise type that surfaces previously hidden errors. These are real bugs - fix them.

References: TypeScript 5.5 announcement · playground

#typescript-5.5#type-predicates#inferred#isolateddeclarations#performance

// discussion

Comments

0/4000
Mahmudul Haque Qudrati — CEO & ML Engineer at Pristren

Mahmudul Haque Qudrati

CEO & ML Engineer

Visionary technologist, software engineer, and machine learning specialist. Founder and CEO of Pristren, directing engineering teams that ship production-grade AI/ML pipelines, mission-critical full-stack applications, and developer tooling. Creator of Zlyqor, the unified team workspace platform. Author of 540+ technical guides and benchmark research reports on large language models, agentic workflows, Model Context Protocol (MCP), and modern web stacks.

PristrenZlyqor