Add base import root interchangeability for missing import lint#5236
Merged
Conversation
Contributor
Preview deploymentsHost Test Results 1 files ±0 1 suites ±0 1h 38m 25s ⏱️ -57s Results for commit 7375deb. ± Comparison against earlier commit 43ec3a9. Realm Server Test Results 1 files ±0 1 suites ±0 10m 35s ⏱️ -1s 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>
3a177d6 to
43ec3a9
Compare
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>
lukemelia
approved these changes
Jun 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a tiny extraction from #5148.