Skip to content

Conversation

martakam
Copy link
Member

@martakam martakam commented Nov 25, 2026 •

Hotel? Trivago.
Prettier plugin to sort imports alphabetically and in groups? Apparently, Trivago too.

The project has become so big that I started to get bothered by our chaotic imports.
This PR adds a Prettier plugin that sorts our imports.

The priority is as follows:

  • Built-in modules in node, such as fs and path
  • Third-party modules, such as React, Better Auth, Drizzle or Base UI
  • Our own, custom modules

These groups are separated by an empty line.

The rules will be enforced by Prettier automatically, and the CI will therefore check for these as well.

Note

No functional changes should appear. The huge amount of files changed should be import sorting only.

Closes #179

@martakam martakam requested a review from a team as a code owner November 25, 2026 21:45
@martakam martakam self-assigned this Nov 25, 2026
@martakam martakam added the refactor Restructuring of existing code in order to easy maintenance, readability or otherwise improve it. label Nov 25, 2026
@martakam martakam added this to the Final Deliverable milestone Nov 25, 2026
hestro
hestro previously approved these changes Nov 26, 2026
Copy link
Member

@hestro hestro left a comment

Choose a reason for hiding this comment

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

Great! I was wondering if something like this was possible. The imports are much easier to read now!

@martakam
Copy link
Member Author

Waiting with merging this until all other open PRs changing code are merged. Merge conflicts will appear.

@martakam martakam merged commit 369e722 into main Nov 26, 2026
8 checks passed
@martakam martakam deleted the style/import-order branch November 26, 2026 17:47
Sign in to join this conversation on GitHub.
Labels
refactor Restructuring of existing code in order to easy maintenance, readability or otherwise improve it.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

style: set one common style for import order
2 participants