windicss / windicss-intellisense

Intelligent WindiCSS tooling for VS Code
https://marketplace.visualstudio.com/items?itemName=voorjaar.windicss-intellisense
MIT License
194 stars 16 forks source link

Sort on save for Attributify mode #290

Closed rileychh closed 2 years ago

rileychh commented 2 years ago

Hello, when I enable Attributify mode, the extension does not care which attribute goes first, and allowed mixing with native HTML attributes. Here's an example:

<!-- Without Attributify and sorted by extension-->
<img
  class="border-dotted rounded-full mx-auto border-5 border-blue-500 my-4 w-32"
  src="@/assets/images/pfp.jpg"
  alt="Profile picture"
/>
<!-- With Attributify -->
<img
  src="@/assets/images/pfp.jpg"
  m="x-auto y-4"
  border="rounded-full dotted 5 blue-500"
  alt="Profile picture"
  w="32"
/>
<!-- Expected behavior -->
<img
  src="@/assets/images/pfp.jpg"
  alt="Profile picture"
  border="rounded-full dotted 5 blue-500"
  m="x-auto y-4"
  w="32"
/>

I got the idea of sorting attributes from eslint-plugin-vue.

alexanderniebuhr commented 2 years ago

you can also track https://github.com/alexanderniebuhr/prettier-plugin-unocss (which I would call the windi css version)