1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-20 22:34:46 -05:00
denoland-deno/cli/tools/lint/rules/no_sloppy_imports.md
David Sherret 763f05e74d
fix(unstable): move sloppy-import warnings to lint rule (#24710)
Adds a new `no-sloppy-imports` lint rule and cleans up the lint code.

Closes #22844
Closes https://github.com/denoland/deno_lint/issues/1293
2024-07-25 09:07:59 -04:00

511 B

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:

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

Valid:

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