oxc/erasing-op
oxc plugin · correctness
{
"rules": {
"oxc/erasing-op": "error"
}
}let x = 1;
let y = x * 0;let x = 1;
let y = 0;Examples from the Oxlint documentation.
ESLint does not have this rule.
oxc/erasing-op
oxc plugin · correctness
{
"rules": {
"oxc/erasing-op": "error"
}
}nursery/noErasingOperation
nursery · since 2.6.6
{
"linter": {
"rules": {
"nursery": {
"noErasingOperation": "error"
}
}
}
}Checks for redundant or logically impossible comparisons. This includes: - Ineffective double comparisons against constants. - Impossible comparisons involving constants. - Redundant comparisons where both operands are the same (e.g., a < a).
Checks whether the throw keyword is missing in front of a new expression.
This rule warns when the replaceAll method is called with a regular expression that does not have the global flag (g).
Checks whether the radix or precision arguments of number-related functions exceed the limit.
Checks for comparisons between object and array literals.
This rule applies when an Array function has a callback argument used for an array with empty slots.