theevents.info

Launches · Microsoft ·

TypeScript 7.1 beta adds Content Mappers for type-checking any file type

A new plugin type lets TypeScript type-check .vue, .svelte, .astro, .sql and other custom files without a wrapper compiler.

What happened

Until now, type-checking non-TS files meant wrapping the compiler (like vue-tsc) or building a language server with Volar. TypeScript 7.1 beta introduces Content Mappers: plugins registered in tsconfig.json that translate a custom file type into a virtual TypeScript file the checker understands.

Mappers run when tsc is called with --runExternalCode, and the virtual files keep references back to the original source so errors point at the right lines.

What it means for you

Framework authors can drop custom type-check wrappers; app developers should see better errors in .vue/.svelte/.astro files as tools adopt it.

Sources

Written by TheEvents from public reporting and the companies’ own announcements. Facts can change as stories develop — check the sources for the latest.

Related