TypeScript Compiler Options
erasableSyntaxOnly — TypeScript compiler option
Rejects TypeScript syntax requiring runtime transformations, including enums and parameter properties. Supports type-stripping workflows but does not check every host restriction or runtime module-resolution rule. Default (5.8.3): false. Create the labeled files in an isolated project and run tsc -p tsconfig.json. No diagnostics; output: none. Local project fixture, not a single-file editor.
Formal Syntax & Structure
typescript syntaxtypescript
{ "compilerOptions": { "erasableSyntaxOnly": true }}Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| erasableSyntaxOnly | boolean | Set in compilerOptions; default: false. |
Working Example
Example Snippettypescript
// File: tsconfig.json (omit this label){ "compilerOptions": { "target": "ES2022", "module": "CommonJS", "strict": true, "types": [], "noEmitOnError": true, "noEmit": true, "erasableSyntaxOnly": true }, "files": [ "main.ts" ]}// File: main.tstype Id = number;const id: Id = 3;