You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are two forms of TypeScript performance issues: build performance (tsc) and editor latency (tsserver). Recognize the symptoms of each and direct your optimizations accordingly.
Keep type checking separate from your build process.
Remove dead code and dependencies, and be on guard for code bloat in type dependencies. Use a treemap to visualize what TypeScript is compiling.
Use incremental builds and project references to reduce the work tsc does between builds.
Simplify your types: avoid large unions, use interface extension rather than intersection types, and consider annotating function return types.## Code Samples
typeDigit='0'|'1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9';typeYear= `2${Digit}${Digit}${Digit}`;constvalidYear: Year='2024';constinvalidYear: Year='1999';// ~~~~~~~~~~~ Type '"1999"' is not assignable to type// '"2000" | "2001" | "2002" | ... 996 more ... | "2999"'.