Hacker News new | ask | show | jobs
by scoresmoke 1533 days ago
TypeScript's checker.ts is a 2.65 MB file containing 44,932 lines at the moment.

https://github.com/microsoft/TypeScript/blob/main/src/compil...

Does anyone know why and how they maintain it?

2 comments

Unlike the OP's file, there's a rather substantial test suite and massive corpus of TypeScript code to work with, so at the very least, you'd have some grumpy people knocking on your door if you did something that negatively impacted the greater ecosystem.

Some documentation from Orta Therox on the checker:

https://github.com/microsoft/TypeScript-Compiler-Notes/blob/...

const anon = "(anonymous)" as __String & string;

What does that even mean? It seems that typescript uses an alias for string as __String in the source but then a bitwise operator with string?