noArguments
¥Summary
-
规则生效日期:
v1.0.0¥Rule available since:
v1.0.0 -
诊断类别:
lint/complexity/noArguments¥Diagnostic Category:
lint/complexity/noArguments -
此规则为推荐规则,默认启用。
¥This rule is recommended, which means is enabled by default.
-
此规则没有修复方案。
¥This rule doesn’t have a fix.
-
此规则的默认严重级别为 warning。
¥The default severity of this rule is warning.
-
来源:
¥Sources:
-
与
prefer-rest-params相同¥Same as
prefer-rest-params
-
¥How to configure
{ "linter": { "rules": { "complexity": { "noArguments": "error" } } }}¥Description
禁止使用 arguments。
¥Disallow the use of arguments.
¥Examples
¥Invalid
function f() { console.log(arguments);}code-block.js:2:16 lint/complexity/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
function f() { let arguments = 1; console.log(arguments);}¥Related links
Biome v2.1 中文网 - 粤ICP备13048890号