TypeScript Compiler Options
noErrorTruncation — TypeScript compiler configuration
Disables the normal shortening of types displayed in diagnostic messages. This can make large structural type mismatches easier to inspect at the cost of longer logs. The example deliberately passes a large object to a never parameter; the full diagnostic includes middle property field25 while the default display replaces middle properties with an abbreviation, retaining the final property. Baseline: TypeScript 5.8.3. Default: false. Create the labeled files in an isolated project; omit file labels. Run the indicated command.
Formal Syntax & Structure
typescript syntaxtypescript
{ "compilerOptions": { "noErrorTruncation": true }}Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| noErrorTruncation | boolean | Compiler option; default: false. |
Working Example
Example Snippettypescript
// File: tsconfig.json (omit this label){ "compilerOptions": { "target": "ES2022", "module": "CommonJS", "strict": true, "types": [], "noEmit": true, "noErrorTruncation": true }, "include": [ "src/**/*.ts" ]}// File: src/index.ts (omit this label)declare function take(x: never): void;take({field00: 0, field01: 1, field02: 2, field03: 3, field04: 4, field05: 5, field06: 6, field07: 7, field08: 8, field09: 9, field10: 10, field11: 11, field12: 12, field13: 13, field14: 14, field15: 15, field16: 16, field17: 17, field18: 18, field19: 19, field20: 20, field21: 21, field22: 22, field23: 23, field24: 24, field25: 25, field26: 26, field27: 27, field28: 28, field29: 29, field30: 30, field31: 31, field32: 32, field33: 33, field34: 34, field35: 35, field36: 36, field37: 37, field38: 38, field39: 39, field40: 40, field41: 41, field42: 42, field43: 43, field44: 44, field45: 45, field46: 46, field47: 47, field48: 48, field49: 49});
// Run in a temporary project:// tsc -p . --pretty false