deno.com

no-dupe-args

注意: 此规则是 recommended 规则集的一部分。
deno.json 中启用完整规则集
{
  "lint": {
    "tags": ["recommended"]
  }
}
使用 Deno CLI 启用完整规则集
deno lint --tags=recommended

禁止在函数签名中多次使用相同的参数名。

如果你向函数提供多个相同名称的参数,则最后一个实例将覆盖前面的实例。这很可能是一个无意的拼写错误。

无效

function withDupes(a, b, a) {
  console.log("I'm the value of the second a:", a);
}

有效

function withoutDupes(a, b, c) {
  console.log("I'm the value of the first (and only) a:", a);
}

你找到你需要的东西了吗?

隐私政策