JavaScript has two ways to say nothing is here, and every TypeScript codebase quietly picks a policy about them, usually without anybody writing it down. I had never written mine down either. So instead of deciding what it should be, I counted what it is.
The subject is Nakodo : 520 non-test TypeScript files, 68,546 lines, a Next 16 app over Postgres.
How it was measured
Word-boundary regular expressions over the source, counting occurrences of each keyword, then the same over the type positions and the comparison forms separately. Tests are excluded throughout, because a test file is full of fixtures that would skew every ratio.
Two traps. The first is that null appears inside strings, SQL fragments and comments, so a bare grep -c null overcounts; I required a non-identifier character on both sides, which still counts the word in a comment and I have accepted that as noise rather than pretend to parse.…