Skip to content

fix(sorting): sorting custom classnames to the front#23

Closed
Stybo wants to merge 2 commits into
sergioazoc:mainfrom
Stybo:main
Closed

fix(sorting): sorting custom classnames to the front#23
Stybo wants to merge 2 commits into
sergioazoc:mainfrom
Stybo:main

Conversation

@Stybo
Copy link
Copy Markdown

@Stybo Stybo commented May 22, 2026

Before:
<div class="p-3 shadow-xl select2-dropdown">

After
<div class="select2-dropdown p-3 shadow-xl">

Closes #22

@sergioazoc
Copy link
Copy Markdown
Owner

Thanks for taking the time to send a fix, @Stybo — genuinely appreciated.

I'm going to close this without merging, for three reasons:

  1. The behavior is already there in v1.0.0. The sort worker calls ds.getClassOrder() and orders null-order (custom/unknown) classes to the front, matching prettier-plugin-tailwindcss. Verified: p-3 shadow-xl select2-dropdownselect2-dropdown p-3 shadow-xl.
  2. The patch targets the pre-v1 tree. v1 reorganized the repo into a pnpm monorepo (packages/oxlint-tailwindcss/src/...) and rewrote the sort path — the heuristic fallback this PR builds on was removed in favor of fail-loud — so it no longer applies cleanly.
  3. The per-variant re-sort would diverge from prettier-plugin-tailwindcss, which the worker matches by construction through getClassOrder.

The original #22 divergence turned out to be a stylesheet-config mismatch (oxfmt and the plugin reading different CSS) — details in #22 and the interop guide: https://oxlint-tailwindcss.pages.dev/interop

Thanks again for the contribution and the detailed reports across #22/#23 — they were genuinely useful in tightening the v1 behavior and docs.

@sergioazoc sergioazoc closed this May 27, 2026
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.

Oxfmt sortTailwindcss and Oxlint-tailwindcss plugin are conflicting eachother.

2 participants