TypeScript · Senior · Question 20 of 75

How do you find the cause of slow type checking in a large project?

Explanation

Diagnostics show the time of each phase and the number of instantiations, and a trace (analyzed with @typescript/analyze-trace or in the browser) shows which types are the most expensive. Common culprits: huge unions, deep recursion, complex intersections, missing return type annotations on exports.

Further reading

Problem with a question

TypeScript · Senior · question 20

Test yourself

Take the TypeScript · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz