noArguments
Summary
Section titled Summary- Rule available since:
v1.0.0
- Diagnostic Category:
lint/style/noArguments
- This rule doesn’t have a fix.
- The default severity of this rule is warning.
- Sources:
- Same as
prefer-rest-params
- Same as
Description
Section titled DescriptionDisallow the use of arguments
.
Examples
Section titled ExamplesInvalid
Section titled Invalidfunction f() { console.log(arguments);}
code-block.js:2:16 lint/style/noArguments ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠ Use the rest parameters instead of arguments.
1 │ function f() {
> 2 │ console.log(arguments);
│ ^^^^^^^^^
3 │ }
4 │
ℹ arguments does not have Array.prototype methods and can be inconvenient to use.
Valid
Section titled Validfunction f() { let arguments = 1; console.log(arguments);}
How to configure
Section titled How to configure{ "linter": { "rules": { "style": { "noArguments": "error" } } }}