Skip to content

Add base import root interchangeability for missing import lint#5236

Merged
backspace merged 2 commits into
mainfrom
rri-resolution-tolerance-cs-10753
Jun 15, 2026
Merged

Add base import root interchangeability for missing import lint#5236
backspace merged 2 commits into
mainfrom
rri-resolution-tolerance-cs-10753

Conversation

@backspace

@backspace backspace commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

This is a tiny extraction from #5148.

@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Preview deployments

Host Test Results

    1 files  ±0      1 suites  ±0   1h 38m 25s ⏱️ -57s
3 066 tests ±0  3 051 ✅ ±0  15 💤 ±0  0 ❌ ±0 
3 085 runs  ±0  3 070 ✅ ±0  15 💤 ±0  0 ❌ ±0 

Results for commit 7375deb. ± Comparison against earlier commit 43ec3a9.

Realm Server Test Results

    1 files  ±0      1 suites  ±0   10m 35s ⏱️ -1s
1 716 tests +1  1 716 ✅ +1  0 💤 ±0  0 ❌ ±0 
1 809 runs  +1  1 809 ✅ +1  0 💤 ±0  0 ❌ ±0 

Results for commit 7375deb. ± Comparison against earlier commit 43ec3a9.

…valent

`missing-card-api-import` matched a configured target module against
existing imports by exact string equality, so a missing import
configured against the RRI prefix form (`@cardstack/base/card-api`)
would not merge into an existing import written in the equivalent
virtual-alias URL form (`https://cardstack.com/base/card-api`) — the
fixer emitted a second, duplicate import line instead.

Add a small `canonicalizeModuleSpecifier` helper (backed by a
`REALM_PREFIX_ALIASES` table) and use it when locating the existing
import, so the two forms are recognized as the same module and the new
specifier merges into the existing line.

This stands alone: it makes the rule tolerant of either form so it
keeps working regardless of which form source files use.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@backspace backspace force-pushed the rri-resolution-tolerance-cs-10753 branch from 3a177d6 to 43ec3a9 Compare June 15, 2026 13:31
@backspace backspace changed the title Change module resolution to handle both RRI forms Add interchangeability base import roots for missing import lint Jun 15, 2026
@backspace backspace marked this pull request as ready for review June 15, 2026 15:23
@backspace backspace changed the title Add interchangeability base import roots for missing import lint Add base import roots interchangeability for missing import lint Jun 15, 2026
@backspace backspace changed the title Add base import roots interchangeability for missing import lint Add base import root interchangeability for missing import lint Jun 15, 2026
Mark the URL↔RRI alias map as removable once the virtual-alias URL
form is fully retired and all source uses the RRI prefix form, at
which point the equivalence helpers collapse to identity.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@backspace backspace requested a review from a team June 15, 2026 17:27
@backspace backspace merged commit 62b8946 into main Jun 15, 2026
58 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants