-
-
Notifications
You must be signed in to change notification settings - Fork 681
Fix false positives for v-bind="obj"
with v-model
in vue/attributes-order
rule
#1771
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
Conversation
{ | ||
filename: 'test.vue', | ||
code: ` | ||
<template> | ||
<div | ||
v-if="x" | ||
v-model="c" | ||
v-bind="b" | ||
v-bind:id="a"> | ||
</div> | ||
</template>`, | ||
output: ` | ||
<template> | ||
<div | ||
v-if="x" | ||
v-bind="b" | ||
v-bind:id="a" | ||
v-model="c"> | ||
</div> | ||
</template>`, | ||
errors: ['Attribute "v-bind:id" should go before "v-model".'] | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this create false positives in existing Vue 2 code? There, the order v-if, v-model, v-bind, v-bind:id
would be perfectly fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there are any false positives because the id
must be before the v-model
.
https://vuejs.org/v2/style-guide/#Element-attribute-order-recommended
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, indeed.
Co-authored-by: Flo Edelmann <[email protected]>
Co-authored-by: Flo Edelmann <[email protected]>
fixes #1767