TypeScript Compiler Options
pretty — TypeScript compiler configuration
Controls colored, contextual diagnostic formatting, not which type errors are reported. Explicit true produces ANSI color sequences in the tested CLI; false produces plain diagnostics. Both configurations report TS2322 for the intentional mismatch. Baseline: TypeScript 5.8.3. Default: true (CLI metadata; automatic terminal detection when omitted). Create the labeled files in an isolated project; omit file labels. Run the indicated command.
Formal Syntax & Structure
typescript syntaxtypescript
{ "compilerOptions": { "pretty": true }}Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| pretty | boolean | Compiler option; default: true (CLI metadata; automatic terminal detection when omitted). |
Working Example
Example Snippettypescript
// File: tsconfig.json (omit this label){ "compilerOptions": { "target": "ES2022", "module": "CommonJS", "strict": true, "types": [], "noEmit": true, "pretty": true }, "include": [ "src/**/*.ts" ]}// File: src/index.ts (omit this label)export const count: number = "bad";
// Run in a temporary project:// tsc -p .