diff --git a/lint/rules/no-import-prefix.md b/lint/rules/no-import-prefix.md index 2c031530d..30de1c1f5 100644 --- a/lint/rules/no-import-prefix.md +++ b/lint/rules/no-import-prefix.md @@ -5,6 +5,10 @@ tags: [workspace] Ensure that all dependencies are declared in either `deno.json` or `package.json`. +This promotes better dependency management and makes it easier to track and +update dependencies. It also helps Deno purge the lockfile when removing a +dependency. + ### Invalid: ```ts @@ -16,6 +20,15 @@ import foo from "npm:preact@10"; ### Valid: ```ts -// Mapped in `deno.json` or `package.json` import foo from "@std/path"; ``` + +With a corresponding entry in the `deno.json` or `package.json` file: + +```jsonc title="deno.json" +{ + "imports": { + "@std/path": "jsr:@std/path@1" + } +} +``` diff --git a/runtime/reference/continuous_integration.md b/runtime/reference/continuous_integration.md index 35b51f592..ff986d2d0 100644 --- a/runtime/reference/continuous_integration.md +++ b/runtime/reference/continuous_integration.md @@ -172,7 +172,7 @@ restore them from cache instead of re-downloading. To demonstrate, let's say you have a project that uses the logger from [`@std/log`](https://jsr.io/@std/log): -```json, title="deno.json" +```json title="deno.json" { "imports": { "@std/log": "jsr:@std/log@0.224.5"