Is there a way to have TypeScript detect this issue? My strictNullChecks
setting is enabled.
const foo: string = 'asdf';
if (foo !== null) {
console.log(foo);
}
If I modify that condition to:
if (foo !== 42) {
The error message displayed is:
This comparison will always evaluate to 'true' since the types 'string' and 'number' are not compatible.