Hacker News new | past | comments | ask | show | jobs | submit login

That behaviour is only enabled if `--strictNullChecks` is set to true. Otherwise, by default all types include null/undefined just like in TypeScript 1.x. So it's entirely opt-in.



But it's all or nothing right? If I write a new component in a pre-2.0 codebase and want strict null checks, I can't get them.


I saw some comments in TypeScript code-bases, that excluded parts of the code.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: