Skip to content

noArgumentsCallerOrCallee (JavaScript)

Language JavaScript (and super languages)
biome.json
{
"linter": {
"rules": {
"nursery": {
"noArgumentsCallerOrCallee": "error"
}
}
}
}

Disallow the use of arguments.caller and arguments.callee.

These deprecated properties prevent JavaScript optimizations and are forbidden in strict mode. Refer to a function by name for recursion, and pass the caller explicitly if you need to access it.

This rule checks dot access, including optional chaining. It also reports these properties on local variables named arguments. Computed access such as arguments["callee"] is not checked.

function factorial(n) {
return n <= 1 ? 1 : n * arguments.callee(n - 1);
}
code-block.js:2:29 lint/nursery/noArgumentsCallerOrCallee ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

⚠ Do not use arguments.callee.

1 │ function factorial(n) {
> 2 │ return n <= 1 ? 1 : n * arguments.callee(n - 1);
│ ^^^^^^^^^^^^^^^^
3 │ }
4 │

ℹ These deprecated properties are forbidden in strict mode and prevent JavaScript optimizations.

ℹ Refer to the function by name for recursion, and pass the caller explicitly if you need to access it.

ℹ This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.

function getCaller() {
return arguments.caller;
}
code-block.js:2:12 lint/nursery/noArgumentsCallerOrCallee ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

⚠ Do not use arguments.caller.

1 │ function getCaller() {
> 2 │ return arguments.caller;
│ ^^^^^^^^^^^^^^^^
3 │ }
4 │

ℹ These deprecated properties are forbidden in strict mode and prevent JavaScript optimizations.

ℹ Refer to the function by name for recursion, and pass the caller explicitly if you need to access it.

ℹ This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.

function factorial(n) {
return n <= 1 ? 1 : n * factorial(n - 1);
}
  • To disallow the use of arguments entirely, see noArguments.