Skip to content
On this page

vue/no-duplicate-attributes

disallow duplication of attributes

  • ⚙️ This rule is included in all of "plugin:vue/vue3-essential", "plugin:vue/essential", "plugin:vue/vue3-strongly-recommended", "plugin:vue/strongly-recommended", "plugin:vue/vue3-recommended" and "plugin:vue/recommended".

When duplicate arguments exist, only the last one is valid. It's possibly mistakes.

📖 Rule Details

This rule reports duplicate attributes. v-bind:foo directives are handled as the attributes foo.

Now loading...

🔧 Options

json
{
  "vue/no-duplicate-attributes": ["error", {
    "allowCoexistClass": true,
    "allowCoexistStyle": true
  }]
}
  • allowCoexistClass (boolean) ... Enables v-bind:class directive can coexist with the plain class attribute. Default is true.
  • allowCoexistStyle (boolean) ... Enables v-bind:style directive can coexist with the plain style attribute. Default is true.

"allowCoexistClass": false, "allowCoexistStyle": false

Now loading...

🚀 Version

This rule was introduced in eslint-plugin-vue v3.0.0

🔍 Implementation