no-mixed-operators
eslint
No autofix
eslint.config.js
export default [
{
rules: {
"no-mixed-operators": "error",
},
},
];This rule is deprecated. Check its documentation for a replacement before enabling it.
var foo = a && b < 0 || c > 0 || d + 1 === 0;
var foo = a + b * c;var foo = a || b || c;
var foo = a && b && c;
var foo = (a && b < 0) || c > 0 || d + 1 === 0;
var foo = a && (b < 0 || c > 0 || d + 1 === 0);
var foo = a + (b * c);
var foo = (a + b) * c;Examples from the ESLint documentation.
no-mixed-operators
eslint
export default [
{
rules: {
"no-mixed-operators": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Require using Error objects as Promise rejection reasons
Disallow specified global variables
Disallow loops with a body that allows only one iteration
Disallow assignment operators in return statements