use-isnan
eslint
SuggestionRecommended
eslint.config.js
export default [
{
rules: {
"use-isnan": "error",
},
},
];if (foo == NaN) {
// ...
}
if (foo != NaN) {
// ...
}
if (foo == Number.NaN) {
// ...
}
if (foo != Number.NaN) {
// ...
}if (isNaN(foo)) {
// ...
}
if (!isNaN(foo)) {
// ...
}Examples from the ESLint documentation.
use-isnan
eslint
export default [
{
rules: {
"use-isnan": "error",
},
},
];use-isnan
eslint plugin · correctness
{
"rules": {
"use-isnan": "error"
}
}correctness/useIsNan
correctness · since 1.0.0
{
"linter": {
"rules": {
"correctness": {
"useIsNan": "error"
}
}
}
}Disallow control characters in regular expressions
Disallow identifiers from shadowing restricted names
Disallow unnecessary escape characters
Disallow assignments to native objects or read-only global variables
Disallow empty character classes in regular expressions