TypeScript Compiler Options
diagnostics — TypeScript compiler diagnostics
Prints aggregate compiler statistics such as file count, memory and phase durations. Use it for an initial view of compiler cost, not application runtime performance. Numbers vary by machine, compiler version, cache state and input. Compare equivalent workloads rather than asserting exact elapsed times. Baseline: TypeScript 5.8.3. Default: false. Create the labeled files in an isolated directory and run the commands below. The CLI prints aggregate statistics including check and total time; exact values vary.
Formal Syntax & Structure
typescript syntaxtypescript
{ "compilerOptions": { "diagnostics": true }}Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| diagnostics | boolean | Compiler option; default: false. |
Working Example
Example Snippettypescript
// File: tsconfig.json (omit this label){ "compilerOptions": { "target": "ES5", "module": "CommonJS", "lib": [ "ES5" ], "strict": true, "types": [], "outDir": "dist", "noEmitOnError": true, "diagnostics": true, "noEmit": true }, "files": [ "index.ts" ]}// File: index.ts (omit this label)export const count: number = 7;
// Run these commands in order in an isolated project:// tsc -p . --pretty false