TypeScript
Diagnostics Commands
Understand and resolve TypeScript compilation errors and performance issues. Learn to read error messages, trace type resolution, and diagnose slow builds.
5 commands
Pro Tips
Use 'tsc --traceResolution' to debug module resolution issues — shows exactly where TypeScript looks for types.
Use 'tsc --generateTrace ./trace' to profile compilation performance and find bottlenecks.
Use 'tsc --listFiles' to see all files included in compilation — helps find unexpected inclusions.
Common Mistakes
Trace and diagnostic flags produce verbose output. Redirect to a file: 'tsc --traceResolution > trace.log 2>&1'.
Slow TypeScript compilation is often caused by deeply nested types or excessive type inference. Simplify complex types.