eqeqeq
eslint
Safe autofix
eslint.config.js
export default [
{
rules: {
"eqeqeq": "error",
},
},
];if (x == 42) { }
if ("" == text) { }
if (obj.getStuff() != undefined) { }a === b
foo === true
bananas !== 1
value === undefined
typeof foo === 'undefined'
'hello' !== 'world'
0 === 0
true === true
foo === nulltypeof foo == 'undefined'
'hello' != 'world'
0 == 0
true == true
foo == nullExamples from the ESLint documentation.
eqeqeq
eslint
export default [
{
rules: {
"eqeqeq": "error",
},
},
];eqeqeq
eslint plugin · pedantic
{
"rules": {
"eqeqeq": "error"
}
}suspicious/noDoubleEquals
suspicious · since 1.0.0
{
"linter": {
"rules": {
"suspicious": {
"noDoubleEquals": "error"
}
}
}
}Disallow comparisons where both sides are exactly the same
Disallow octal escape sequences in string literals
Disallow the use of eval()-like methods