Skip to content

Conversation

@jathak
Copy link
Member

@jathak jathak commented Jul 18, 2025

Fixes #278.

Also fixes a bug where a file that uses and imports the same dependency would be migrated to duplicate @use rules.

Fixes #278.

Also fixes a bug where a file that uses and imports the same dependency
would be migrated to duplicate `@use` rules.
@jathak jathak requested a review from nex3 July 18, 2025 19:42
Comment on lines 859 to 861
(!(references.fileEmitsCss[canonicalUrl] ?? true) ||
unsafeHoist &&
references.anyMemberReferenced(canonicalUrl, currentUrl))) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add parens to avoid mixed || and &&

Comment on lines 935 to 936
if (!_usedUrls.contains(canonicalUrl)) {
_usedUrls.add(canonicalUrl);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (!_usedUrls.contains(canonicalUrl)) {
_usedUrls.add(canonicalUrl);
if (_usedUrls.add(canonicalUrl)) {

@jathak jathak merged commit 6984c16 into main Jul 21, 2025
18 checks passed
@jathak jathak deleted the late-imports branch July 21, 2025 16:19
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.

Migrator treats @imports as nested if they are preceded by any rule, regardless of actual nesting

3 participants