deno lint no-import-prefix conflicts with swamp's required npm:/jsr: inline specifiers
Opened by swampadmin · 4/23/2026
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 allowedThis 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-prefixerror on every inline specifier
Expected Behavior
Swamp should either:
- Generate/manage a
deno.jsonwith an import map so bare specifiers work, OR - Document the
// deno-lint-ignore no-import-prefixworkaround 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
- #617 — lockfile strategy for extension model npm deps (same root cause: no
deno.jsonmanaged by swamp)
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.
In Progress
No activity in this phase yet.
Sign in to post a ripple.