prettier-plugin-organize-attributes icon indicating copy to clipboard operation
prettier-plugin-organize-attributes copied to clipboard

[Feature Request] Add support for sorting the attribute's content

Open dtslvr opened this issue 2 years ago • 4 comments

For this template

<div
  class="text-muted text-center"
></div>

it would be handy if the plugin automatically sorts the value of the attribute class:

<div
  class="text-center text-muted"
></div>

dtslvr avatar Oct 06 '23 13:10 dtslvr

Fyi I think there's an extra plugin for tailwind or something similar. Not that I'm opposed to adding the feature.

NiklasPor avatar Oct 06 '23 14:10 NiklasPor

There is indeed prettier-plugin-tailwindcss which might just be what you're looking for.

jeannemas avatar Oct 11 '23 03:10 jeannemas

There is indeed prettier-plugin-tailwindcss which might just be what you're looking for.

Thank you for the link @jeannemas. Unfortunately, it seems there is no equivalent plugin available for bootstrap (https://github.com/twbs/bootstrap/issues/38397).

dtslvr avatar Oct 11 '23 05:10 dtslvr

And on top of that, Bootstrap prefers not to have any ordering system which is a bummer.

I mean generally speaking we all kinda agree that you start with display/layout and then finish off with smaller stuff like colors, emphasis, shadows are somewhere in between..

I know code runs just the same no matter the order but I would like to see some consistency - making inline style more readable should not be "low priority" for BS.

Hnnx avatar Mar 02 '24 12:03 Hnnx