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

[Lint] Sort imports #2104

Merged
merged 4 commits into from
Dec 30, 2024
Merged

[Lint] Sort imports #2104

merged 4 commits into from
Dec 30, 2024

Conversation

huchenlei
Copy link
Member

@huchenlei huchenlei commented Dec 30, 2024

This PR adds @trivago/prettier-plugin-sort-imports to auto sort imports.

Following rule defines the sort order:

{
  "importOrder": ["^@core/(.*)$", "<THIRD_PARTY_MODULES>", "^@/(.*)$", "^[./]"],
}
  • Core javascript modules
  • Third party modules
  • Absolute path module import that starts with @/
  • Relative path Module import that starts with ./

@huchenlei huchenlei requested review from trsommer, a team and jtydhr88 as code owners December 30, 2024 22:09
Copy link

socket-security bot commented Dec 30, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@trivago/prettier-plugin-sort-imports@5.2.0 Transitive: environment, eval, filesystem, unsafe +25 11 MB

View full report↗︎

@huchenlei huchenlei merged commit d8f074f into main Dec 30, 2024
10 checks passed
@huchenlei huchenlei deleted the sort_imports branch December 30, 2024 22:26
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.

1 participant