Tell us about your environment
Please show your full configuration:
"vue/attributes-order": [2, {
order: [
"DEFINITION",
"LIST_RENDERING",
"CONDITIONALS",
"RENDER_MODIFIERS",
"GLOBAL",
"UNIQUE",
"CONTENT",
"OTHER_ATTR",
"BINDING",
"EVENTS"
]
}]
What did you do? Please include the actual source code causing the issue.
<div v-if="isVisible" v-dom-portal="true" :class="classes"></div>
What did you expect to happen?
v-dom-portal directive should not fail linting, as it should be OTHER_ATTR imo
What actually happened? Please include the actual, raw output from ESLint.
Instead it seems to be recognised as either DEFINITION or LIST_RENDERING, and the following message displays:
Attribute "v-dom-portal" should go before "v-if". (vue/attributes-order)
Having similar issue after updating to eslint-plugin-vue 4.3.0.
Yup, same thing here. Seems to happen with any custom directive in the form v-xxxx
I think all custom directives should be recognised as OTHER_ATTR, and I have submitted a PR and wait for review.
Yes, all custom directives should be recognised as OTHER_ATTR, but bindings do not count here @ydfzgyj
I'm giving it second thought, and maybe we should create another category for OTHER_DIRECTIVES? I wouldn't want to see them mixed with normal attributes and bindings, how about you?
What about letting us cherrypick the exact attributes? For example, I would like the v-t directive (from vue-i18n) to be grouped with v-text and v-html, while having the other directives in a different priority.
"vue/attributes-order": [2, {
order: [
"DEFINITION",
"LIST_RENDERING",
"CONDITIONALS",
"RENDER_MODIFIERS",
"GLOBAL",
"UNIQUE",
"BINDING",
"OTHER_ATTR",
"EVENTS",
["CONTENT", "v-t"],
],
}]
I agree with @skyrpex, I also think we should put them all into a separate category, but translation ones should go into content.
Most helpful comment
What about letting us cherrypick the exact attributes? For example, I would like the
v-tdirective (from vue-i18n) to be grouped withv-textandv-html, while having the other directives in a different priority.