Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(lint/origanizeImports): use the correct export name to sort in the import clause #1936

Merged
merged 5 commits into from
Feb 28, 2024

Conversation

ah-yu
Copy link
Contributor

@ah-yu ah-yu commented Feb 28, 2024

Summary

For the following case

import { a1 as a3, a2 } from 'a'

We used to use a1 and a2 for sorting. The reported bug occurs when a1 is the same as a2. Now we use a3 and a2 for sorting.

This fix may alter the original behavior. The above code snippet was formatted as import { a1 as a3, a2 } from 'a' before, but now it's formatted as import { a2, a1 as a3 } from 'a'.

Eslint uses a3 and a2 for sorting: link

Test Plan

Add new test cases

@github-actions github-actions bot added A-Linter Area: linter A-Parser Area: parser A-Website Area: website L-JavaScript Language: JavaScript and super languages A-Changelog Area: changelog labels Feb 28, 2024
Copy link

netlify bot commented Feb 28, 2024

Deploy Preview for biomejs ready!

Name Link
🔨 Latest commit 7fe976e
🔍 Latest deploy log https://app.netlify.com/sites/biomejs/deploys/65df0b3bf035d30008dffbac
😎 Deploy Preview https://deploy-preview-1936--biomejs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 99 (🔴 down 1 from production)
Accessibility: 97 (no change from production)
Best Practices: 100 (no change from production)
SEO: 93 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

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

I do believe the change is reasonable. FYI, we don't follow any particular plugin, we own the import sorting through and through :)

@ematipico ematipico merged commit 0e6910e into biomejs:main Feb 28, 2024
18 checks passed
@ah-yu ah-yu deleted the import_sort branch February 29, 2024 02:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Changelog Area: changelog A-Linter Area: linter A-Parser Area: parser A-Website Area: website L-JavaScript Language: JavaScript and super languages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 Import sorting "forgets" import
2 participants