-
-
Notifications
You must be signed in to change notification settings - Fork 682
Rule enhancement: vue/attributes-order #968
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
If no one has picked this up yet I can grab it, it's an enhancement to the rule I added a while back here anyway #209 |
It's been a while since I've contributed 😄 so I'm sure I missed a step or two in there, but the code works.
would be incorrect because |
Hm, as far as I remember I intended to sort first by type (event, prop, directive, condition) and second by key-name (without Did I get something wrong or did you @erindepew ? |
🤔I think we agree on this @sense-it-gmbh and maybe I was just confused by the initial example. Mind taking a look at the tests I wrote for this and see if it all works the way you were expecting? |
I tried but I'm afraid I don't know enough about how these work so I cant really tell whether they are as expected. |
So you can review either the documentation I added: But it's fine, your example works and this will give you the output you're expecting. I just misspoke above. |
Please describe what the rule should do:
Enforce alphabetic order within attributes of same block (eg
DEFINITION
,LIST_RENDERING
, see rule details). This concerns mainly the custom attributes and directives, events and global attributes (OTHER_DIRECTIVES
,OTHER_ATTR
,GLOBAL
,EVENTS
).This could be an optional rule-option.
What category should the rule belong to?
Provide 2-3 code examples that this rule should warn about:
<!-- ✓ GOOD --> <my-component a-custom-prop="value" :another-custom-prop="1 + 1" :blue-color="false" boolean-prop-again z-prop="Z" @change="someMethod" @input="someOtherMethod" > <!-- content --> </my-component> <!-- ✗ BAD --> <my-component z-prop="Z" :another-custom-prop="1 + 1" :blue-color="false" boolean-prop-again a-custom-prop="value" @input="someOtherMethod" @change="someMethod" > <!-- content --> </my-component>
Additional context
The text was updated successfully, but these errors were encountered: