no-caller
eslint
No autofix
eslint.config.js
export default [
{
rules: {
"no-caller": "error",
},
},
];function foo(n) {
if (n <= 0) {
return;
}
arguments.callee(n - 1);
}
[1,2,3,4,5].map(function(n) {
return !(n > 1) ? 1 : arguments.callee(n - 1) * n;
});function foo(n) {
if (n <= 0) {
return;
}
foo(n - 1);
}
[1,2,3,4,5].map(function factorial(n) {
return !(n > 1) ? 1 : factorial(n - 1) * n;
});Examples from the ESLint documentation.
no-caller
eslint
export default [
{
rules: {
"no-caller": "error",
},
},
];no-caller
eslint plugin · correctness
{
"rules": {
"no-caller": "error"
}
}nursery/noArgumentsCallerOrCallee
nursery · since 2.6.0
{
"linter": {
"rules": {
"nursery": {
"noArgumentsCallerOrCallee": "error"
}
}
}
}Disallow renaming import, export, and destructured assignments to the same name
Disallow losing originally caught error when re-throwing custom errors
Require spread operators instead of .apply()
Disallow the use of undeclared variables unless mentioned in /*global */ comments