Never check directly against undefined or null. Instead, use isSome.
This rule aims to ensure that we don't treat undefined and null differently in our code, since doing so tends to cause confusion.
Autofixer available.
Examples of incorrect code for this rule:
if (x !== undefined) {
return x;
}Examples of correct code for this rule:
if (isSome(x)) {
return x;
}If you're dealing with third-party code that needs to differentiate between undefined and null.