vue/no-duplicate-attributes
disallow duplication of attributes
- ⚙️ This rule is included in the following preset configs:
*.configs["flat/essential"]*.configs["flat/vue2-essential"]*.configs["flat/strongly-recommended"]*.configs["flat/vue2-strongly-recommended"]*.configs["flat/recommended"]*.configs["flat/vue2-recommended"]"plugin:vue/essential""plugin:vue/vue2-essential""plugin:vue/strongly-recommended""plugin:vue/vue2-strongly-recommended""plugin:vue/recommended""plugin:vue/vue2-recommended"
When there are multiple attributes with the same name on a component, only the last one is used and the rest are ignored, so this is usually a mistake.
📖 Rule Details
This rule reports duplicate attributes. v-bind:foo directives are handled as the attribute foo.
🔧 Options
json
{
"vue/no-duplicate-attributes": ["error", {
"allowCoexistClass": true,
"allowCoexistStyle": true
}]
}allowCoexistClass(boolean) ... Enablesv-bind:classdirective can coexist with the plainclassattribute. Default istrue.allowCoexistStyle(boolean) ... Enablesv-bind:styledirective can coexist with the plainstyleattribute. Default istrue.
"allowCoexistClass": false, "allowCoexistStyle": false
🚀 Version
This rule was introduced in eslint-plugin-vue v3.0.0