no-confusing-arrow
eslint
Safe autofix
eslint.config.js
export default [
{
rules: {
"no-confusing-arrow": "error",
},
},
];This rule is deprecated. Check its documentation for a replacement before enabling it.
Disallow arrow functions where they could be confused with comparisons
var x = a => 1 ? 2 : 3;
var x = (a) => 1 ? 2 : 3;var x = a => (1 ? 2 : 3);
var x = (a) => (1 ? 2 : 3);
var x = (a) => {
return 1 ? 2 : 3;
};
var x = a => { return 1 ? 2 : 3; };Examples from the ESLint documentation.
no-confusing-arrow
eslint
export default [
{
rules: {
"no-confusing-arrow": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Require return statements to either always or never specify values
Disallow dangling underscores in identifiers
Disallow variable declarations from shadowing variables declared in the outer scope