2 ms·
This explanation makes sense of how they arrived at this, but it still doesn’t make sense to me under the flag. It’s type checking: 1. Something that can never
by eyelidlessness 6y ago
This explanation makes sense of how they arrived at this, but it still doesn’t make sense to me under the flag. It’s type checking:
1. Something that can never be null
2. Based on code that’s not present
3. Which even if it were present wouldn’t necessarily be subject to strictNullChecks (even the example they used wouldn’t!)
Having had some more time to think about it, not only do I think it’s odd, I think it should change (and my next stop is their GH issues to say so/upvote whoever already has). It violates the principle of least surprise, which is very much at odds with the language’s mission.
Note that I’m not necessarily advocating for yet another flag/compilerOptions entry. I’d much rather they roll everything up in `strict`, and I’d even more rather they remove the non-strict option altogether for .ts files.