Skip to main content

no-import-prefix

NOTE: this rule is part of the workspace rule set.
Enable full set in deno.json:
{
  "lint": {
    "rules": {
      "tags": ["workspace"]
    }
  }
}
Enable full set using the Deno CLI:
deno lint --rules-tags=workspace
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-import-prefix"],
      "exclude": ["no-import-prefix"]
    }
  }
}

确保所有依赖项都在 deno.jsonpackage.json 中声明。

无效示例: Jump to heading

import foo from "https://deno.land/std/path/mod.ts";
import foo from "jsr:@std/path@1";
import foo from "npm:preact@10";

有效示例: Jump to heading

// 在 `deno.json` 或 `package.json` 中映射
import foo from "@std/path";

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

编辑此页面
隐私政策