verbatimModuleSyntax

The compiler option that keeps every import and export exactly as written, except those marked type, which are removed.

In more detail

It makes the output predictable for tools that compile one file at a time, such as esbuild, SWC and Node.js type stripping. Importing an interface without the type keyword becomes an error. It replaced the older importsNotUsedAsValues and preserveValueImports options in TypeScript 5.0.

Related terms

Taught in

References