oxc/bad-bitwise-operator
oxc plugin · restriction
{
"rules": {
"oxc/bad-bitwise-operator": "error"
}
}This rule applies when bitwise operators are used where logical operators are expected.
e && e.x
e || {}
e || ''if (obj & obj.prop) {
console.log(obj.prop);
}
options = options | {};
input |= '';if (obj && obj.prop) {
console.log(obj.prop);
}
options = options || {};
input ||= '';Examples from the Oxlint documentation.
ESLint does not have this rule.
oxc/bad-bitwise-operator
oxc plugin · restriction
{
"rules": {
"oxc/bad-bitwise-operator": "error"
}
}nursery/noAccidentalBitwiseOperators
nursery · since 2.6.0
{
"linter": {
"rules": {
"nursery": {
"noAccidentalBitwiseOperators": "error"
}
}
}
}Checks if the if and else blocks contain shared code that can be moved out of the blocks.
Disallows the use of approximate constants, instead preferring the use of the constants in the Math object.
Https://rust-lang.github.io/rust-clippy/master/#/misrefactored_assign_op
Prevents using object or array spreads on accumulators in Array.prototype.reduce() and in loops.
Disallows the use of async functions as Express endpoint handlers.
Disallow the use of barrel files where the file contains export * statements, and the total number of modules exceeds a threshold.