oxc/only-used-in-recursion
oxc plugin · correctness
{
"rules": {
"oxc/only-used-in-recursion": "error"
}
}Checks for arguments that are only used in recursion with no side-effects.
function test(onlyUsedInRecursion) {
return test(onlyUsedInRecursion);
}function f(a: number): number {
if (a == 0) {
return 1
} else {
return f(a - 1)
}
}Examples from the Oxlint documentation.
ESLint does not have this rule.
oxc/only-used-in-recursion
oxc plugin · correctness
{
"rules": {
"oxc/only-used-in-recursion": "error"
}
}suspicious/noParametersOnlyUsedInRecursion
suspicious · since 2.3.3
{
"linter": {
"rules": {
"suspicious": {
"noParametersOnlyUsedInRecursion": "error"
}
}
}
}This rule checks for double comparisons in logical expressions.
This rule applies when an Array function has a callback argument used for an array with empty slots.
Checks whether the radix or precision arguments of number-related functions exceed the limit.
Checks whether the throw keyword is missing in front of a new expression.
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).