NiklasPor / prettier-plugin-organize-attributes

Organize your HTML attributes automatically with Prettier 🧼
MIT License
197 stars 12 forks source link

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

Open dtslvr opened 11 months ago

dtslvr commented 11 months ago

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>
NiklasPor commented 11 months ago

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

jeannemas commented 11 months ago

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

dtslvr commented 11 months ago

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).

Hnnx commented 6 months ago

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.