How can I improve my attribute sorting? #190
Replies: 3 comments 1 reply
-
@SkyaTura do you want to have a look into this? If I remember correctly, you provided this feature 🙂 |
Beta Was this translation helpful? Give feedback.
-
Currently is not possible to differentiate between attributes that have or have not specified values (or better saying, between strings and booleans) because during sort this information isn't available. Also, I believe there is a bug that prevents |
Beta Was this translation helpful? Give feedback.
-
Do we have any progress on that? @Shinigami92 @SkyaTura |
Beta Was this translation helpful? Give feedback.
-
Question
Hey everyone. I have a pug element like below and want to order it like the "Expected Output". My dream ordering is:
1-
v-if
,v-else
andv-else-if
2-
v-model
3- Any attribute starts with
v-
4-
v-for
(It should always come after the otherv-
's)5-
:key
to seev-for
and:key
always together.6- Any attribute starts with
@
7- Any attribute starts with
:
8- Attributes starts with
ref
9- Static attributes which has a value like
type='text'
10- Any other static attributes which doesn't have a value like
disabled
,required
etc.Plus: On same priority level, always sort alphabetically.
I wonder currently this plugin satisfies that or need to develop a feature for it. Thank you!
Input
Expected Output
Additional Context
My current
.prettierrc
file (Without comments) like below. Even it helps a lot to reach my target, it still not fully works and some of my expectations not satisfies like putting:key
behindv-for
and putting static attributes with a value above the attributes without value liketype="text"
overdisabled
Beta Was this translation helpful? Give feedback.
All reactions