Skip to content

deno lint no-import-prefix conflicts with swamp's required npm:/jsr: inline specifiers #758

@bixu

Description

@bixu

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

  1. Create a swamp extension model with import { z } from "npm:zod@4";
  2. Run deno lint extensions/models/
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions