Open
Description
the rationale is the same as for --noUnusedLocals
which in this case would be --noUselessNullChecks
(i am not proposing a new flag, the existing --strictNullChecks
flag should be used, this is for illustration only)
declare const value: number;
if (value !== null) { // <-- somehow valid, expected to be invalid, since number doesn't have null as a possible value
}
if (value !== '') { // <-- invalid as expected
}