deno.com

no-sloppy-imports

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

强制在模块标识符中显式指定路径引用。

非显式标识符是模糊的,每次运行时都需要探测正确的文件路径,这会带来性能开销。

注意:此 lint 规则仅在使用 --unstable-sloppy-imports 时激活。

无效:Jump to heading

import { add } from "./math/add";
import { ConsoleLogger } from "./loggers";

有效:Jump to heading

import { add } from "./math/add.ts";
import { ConsoleLogger } from "./loggers/index.ts";

您找到您需要的内容了吗?

隐私政策