Description
Swamp extension models require npm: and jsr: inline import specifiers (e.g., import { z } from "npm:zod@4") because there is no deno.json or import map managed by swamp. However, Deno's built-in linter flags every one of these with the no-import-prefix rule:
error[no-import-prefix]: Inline 'npm:', 'jsr:' or 'https:' dependency not allowed
This forces every extension model file and test file to include a // deno-lint-ignore no-import-prefix suppress comment on each inline import.
Steps to Reproduce
- Create a swamp extension model with
import { z } from "npm:zod@4";
- Run
deno lint extensions/models/
- Observe
no-import-prefix error on every inline specifier
Expected Behavior
Swamp should either:
- Generate/manage a
deno.json with an import map so bare specifiers work, OR
- Document the
// deno-lint-ignore no-import-prefix workaround as expected, OR
- Provide a lint config that suppresses this rule for extension model directories
Environment
- swamp version: 20260318.021802.0-sha.3848499d
- Deno version: 2.2.8
- OS: macOS Darwin 25.3.0
Related
Summary
The fix would involve swamp managing a deno.json (or deno.jsonc) in the extensions directory that maps bare specifiers to their npm:/jsr: equivalents. This would resolve both the lint warnings and the lockfile gap from #617 in one change. Affected component: extension model scaffolding and the swamp extension CLI commands.
Description
Swamp extension models require
npm:andjsr:inline import specifiers (e.g.,import { z } from "npm:zod@4") because there is nodeno.jsonor import map managed by swamp. However, Deno's built-in linter flags every one of these with theno-import-prefixrule:This forces every extension model file and test file to include a
// deno-lint-ignore no-import-prefixsuppress comment on each inline import.Steps to Reproduce
import { z } from "npm:zod@4";deno lint extensions/models/no-import-prefixerror on every inline specifierExpected Behavior
Swamp should either:
deno.jsonwith an import map so bare specifiers work, OR// deno-lint-ignore no-import-prefixworkaround as expected, OREnvironment
Related
deno.jsonmanaged by swamp)Summary
The fix would involve swamp managing a
deno.json(ordeno.jsonc) in the extensions directory that maps bare specifiers to theirnpm:/jsr:equivalents. This would resolve both the lint warnings and the lockfile gap from #617 in one change. Affected component: extension model scaffolding and theswamp extensionCLI commands.