no-sloppy-imports
NOTE: this rule is part of the
recommended rule set.Enable full set in
deno.json:{
"lint": {
"rules": {
"tags": ["recommended"]
}
}
}Enable full set using the Deno CLI:
deno lint --rules-tags=recommended
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-sloppy-imports"],
"exclude": ["no-sloppy-imports"]
}
}
}Enforces specifying explicit references to paths in module specifiers.
Non-explicit specifiers are ambiguous and require probing for the correct file path on every run, which has a performance overhead.
Note: This lint rule is only active when using --unstable-sloppy-imports.
Invalid: Jump to heading
import { add } from "./math/add";
import { ConsoleLogger } from "./loggers";
Valid: Jump to heading
import { add } from "./math/add.ts";
import { ConsoleLogger } from "./loggers/index.ts";