Skip to content

Proposal: Enforce import order rules via oxlint/oxfmt (or relax the docs) #2253

Open

Description

@RYGRIT

Hey folks 👋

I noticed we have specific import order rules in CONTRIBUTING.md (Types first -> Ext packages -> Int aliases -> Relative), but they aren't currently enforced by our linters, so they often get missed across app/ and server/.

I originally tried to fix this manually across the codebase in #2231, but @ghostdevv correctly pointed out that unless we automate this via oxlint/oxfmt, it's not sustainable and will just lead to subjective diffs. Plus, Nuxt auto-imports handle a lot of this anyway.

I took a quick look at our current Vite+ tooling:

  • Current oxlint only supports the base ESLint sort-imports, which just alphabetizes members but doesn't handle path grouping or custom groupings.
  • eslint-plugin-import/order and related grouping rules aren't natively ported to oxc yet.
  • oxfmt doesn't currently easily accept JS-based import-sorting plugins like Prettier does.

Given the tooling limitations, I wanted to see what the team prefers:

  1. Do we just hold off until oxlint natively supports advanced path-based grouping?
  2. Should we update CONTRIBUTING.md to relax/remove the strict import order rules for now to prevent confusion for contributors?
  3. Is there some other Vite+ config I missed that could handle this programmatically?

Happy to send a PR to update the docs if we decide to go with option 2!

Activity

  1. ghostdevv commented on Mar 24, 2026

    @ghostdevv
    Member

    I noticed we have specific import order rules in CONTRIBUTING.md (Types first -> Ext packages -> Int aliases -> Relative), but they aren't currently enforced by our linters, so they often get missed across app/ and server/.

    I looked for this earlier and missed it 🤦‍♀️

  2. added theissue type on Mar 24, 2026
  3. added
    needs discussionAn idea that needs more discussion to understand the scope and impact.
    on Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs discussionAn idea that needs more discussion to understand the scope and impact.

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions