Skip to content

Commit ad7c87b

Browse files
authored
chore: enable no-import-prefix lint rule (#7226)
Enable the no-import-prefix lint rule and resolve the remaining inline specifiers it flags: - _tools/check_mod_exports.ts: import typescript via a bare specifier declared in deno.json (replacing the orphaned npm:/typescript entry). - crypto/_benches/bench.ts: drop the comparison against the years-old jsr:@std/crypto@0.220.1 TypeScript FNV implementation. - html/_tools/generate_data.ts: ignore the rule for the one-off spec-data codegen fetch.
1 parent c896737 commit ad7c87b

4 files changed

Lines changed: 7 additions & 16 deletions

File tree

_tools/check_mod_exports.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { walk } from "../fs/walk.ts";
55
import { relative } from "../path/relative.ts";
66
import { dirname } from "../path/dirname.ts";
77
import * as colors from "../fmt/colors.ts";
8-
import ts from "npm:typescript@5.8.3";
8+
import ts from "typescript";
99
import { getEntrypoints } from "./utils.ts";
1010
import { fromFileUrl } from "@std/path/from-file-url";
1111

crypto/_benches/bench.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import { crypto as stdCrypto, type DIGEST_ALGORITHM_NAMES } from "../mod.ts";
44

55
import nodeCrypto from "node:crypto";
66

7-
import { crypto as oldCrypto } from "jsr:@std/crypto@0.220.1";
8-
97
const webCrypto = globalThis.crypto;
108

119
const BENCHMARKED_DIGEST_ALGORITHM_NAMES = [
@@ -57,17 +55,6 @@ for (
5755
},
5856
});
5957

60-
if (name.startsWith("FNV")) {
61-
Deno.bench({
62-
group: `digesting ${humanLength}`,
63-
name:
64-
`${name} from std/crypto (v0.220.1) TypeScript digesting ${humanLength}`,
65-
async fn() {
66-
await oldCrypto.subtle.digest(name, buffer);
67-
},
68-
});
69-
}
70-
7158
if (
7259
(WEB_CRYPTO_DIGEST_ALGORITHM_NAMES as readonly string[]).includes(name)
7360
) {

deno.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
"imports": {
1010
"@deno/graph": "jsr:@deno/graph@^0.89.2",
1111
"@deno/doc": "jsr:@deno/doc@^0.169.1",
12-
"npm:/typescript": "npm:typescript@5.8.2",
1312
"automation/": "https://raw.githubusercontent.com/denoland/automation/0.10.0/",
1413
"fast-check": "npm:fast-check@3.8.0",
15-
"graphviz": "npm:node-graphviz@^0.1.1"
14+
"graphviz": "npm:node-graphviz@^0.1.1",
15+
"typescript": "npm:typescript@5.8.3"
1616
},
1717
"unstable": ["webgpu", "fs"],
1818
"tasks": {
@@ -52,6 +52,7 @@
5252
"tags": ["recommended", "jsr"],
5353
"include": [
5454
"camelcase",
55+
"no-import-prefix",
5556
"no-sync-fn-in-async-fn",
5657
"single-var-declarator",
5758
"no-console"

html/_tools/generate_data.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33

44
// JSON version of the full canonical list of named HTML entities
55
// https://html.spec.whatwg.org/multipage/named-characters.html
6+
// This is a one-off codegen fetch of a spec data file, not a project
7+
// dependency, so it is imported directly rather than via the import map.
8+
// deno-lint-ignore no-import-prefix
69
import entityList from "https://html.spec.whatwg.org/entities.json" with {
710
type: "json",
811
};

0 commit comments

Comments
 (0)