oxc/bad-array-method-on-arguments
oxc plugin · correctness
{
"rules": {
"oxc/bad-array-method-on-arguments": "error"
}
}This rule applies when an array method is called on the arguments object itself.
function add(x, y) {
return x + y;
}
function sum() {
return arguments.reduce(add, 0);
}function add(x, y) {
return x + y;
}
function sum(...args) {
return args.reduce(add, 0);
}Examples from the Oxlint documentation.
ESLint does not have this rule.
oxc/bad-array-method-on-arguments
oxc plugin · correctness
{
"rules": {
"oxc/bad-array-method-on-arguments": "error"
}
}nursery/noArrayMethodsOnArguments
nursery · since 2.6.6
{
"linter": {
"rules": {
"nursery": {
"noArrayMethodsOnArguments": "error"
}
}
}
}This rule warns when a character accessed with charAt, at, or bracket notation is compared with a string of length greater than 1.
This rule applies when the comparison operator is applied two or more times in a row.
This rule warns when the matchAll method is called with a regular expression that does not have the global flag (g).
Checks whether the clamp function Math.min(Math.max(x, y), z) always evaluates to a constant result because the arguments are in the wrong order.
Checks for comparisons between object and array literals.
This rule warns when the replaceAll method is called with a regular expression that does not have the global flag (g).