Is it possible to support a custom class order setting? #48
Replies: 2 comments
-
Oh ahh I see the issue. Tailwind
and this plugin sorts on that. The interesting thing though is that it is roughly placed in the right place (see the This horrible hack tries to assign a sort-order value based on siblings which actually sort of works:
but probably isn't the right thing to do. This feels like it's a feature request for Tailwind itself, I think? |
Beta Was this translation helpful? Give feedback.
-
I don't think tailwind would implement such a feature, as they followed prettiers approach of zero configurability:
I am open to add such a feature to this ESLint plugin, but I can't see how the configuration for this could look like. The weights returned from the official sorting order vary depending of the available classes, so I'm not sure if it is even possible to reliably sort them in between builtin tailwind classes. Just sorting them to the end (before the variants) would certainly be easier and wouldn't require any configuration. I will try this out when I have some time. If you'd like to contribute, I'd be happy to accept a pull request. |
Beta Was this translation helpful? Give feedback.
-
Hi!
We have some custom tailwind classes for our typography styles all prefixed
typo-
. In my ideal world they'd be sorted after the existingtext-
andfont-
ones, but this seems to ignore them right now (I'd also be fine if they were consistently sorted after all the built-in ones, which may be easier).Would it be possible to expose an "additional sort order" setting which would support this?
Happy to contribute.
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions