Does eslint have a rule that flags an error for the code snippet below:
function parseNumber(numberToCheck: number | undefined) {
// I want an error here: !0 is true, so we will get "no number" here
if (!numberToCheck) {
return "no number";
} else {
return "number";
}
}
The use of if (!number) {...}
check has caused numerous errors and it is frustrating, hence, I would like to prevent this kind of checking in my code.