Skip to content

Commit c956538

Browse files
authored
Add reasoning for no-import-prefix (#2739)
1 parent 595c151 commit c956538

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

lint/rules/no-import-prefix.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ tags: [workspace]
55
Ensure that all dependencies are declared in either `deno.json` or
66
`package.json`.
77

8+
This promotes better dependency management and makes it easier to track and
9+
update dependencies. It also helps Deno purge the lockfile when removing a
10+
dependency.
11+
812
### Invalid:
913

1014
```ts
@@ -16,6 +20,15 @@ import foo from "npm:preact@10";
1620
### Valid:
1721

1822
```ts
19-
// Mapped in `deno.json` or `package.json`
2023
import foo from "@std/path";
2124
```
25+
26+
With a corresponding entry in the `deno.json` or `package.json` file:
27+
28+
```jsonc title="deno.json"
29+
{
30+
"imports": {
31+
"@std/path": "jsr:@std/path@1"
32+
}
33+
}
34+
```

runtime/reference/continuous_integration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ restore them from cache instead of re-downloading.
172172
To demonstrate, let's say you have a project that uses the logger from
173173
[`@std/log`](https://jsr.io/@std/log):
174174

175-
```json, title="deno.json"
175+
```json title="deno.json"
176176
{
177177
"imports": {
178178
"@std/log": "jsr:@std/log@0.224.5"

0 commit comments

Comments
 (0)