简中文档

no-global-assign

NOTE: this rule is part of the 推荐 rule set.
Enable full set in deno.json:
{
  "lint": {
    "rules": {
      "tags": ["推荐"]
    }
  }
}
Enable full set using the Deno CLI:
deno lint --rules-tags=推荐
This rule can be explictly included to or excluded from the rules present in the current tag by adding it to the include or exclude array in deno.json:
{
  "lint": {
    "rules": {
      "include": ["no-global-assign"],
      "exclude": ["no-global-assign"]
    }
  }
}

禁止对原生 Javascript 对象进行赋值。

在 Javascript 中,StringObject 例如是原生对象。像任何对象一样,它们可以被重新赋值,但几乎永远不明智,因为这可能导致意想不到的结果和难以追踪的错误。

无效:

Object = null;
undefined = true;
window = {};

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

编辑此页面
隐私政策