Skip to content

Latest commit

 

History

History
51 lines (35 loc) · 1.25 KB

no-duplicate-attributes.md

File metadata and controls

51 lines (35 loc) · 1.25 KB

disallow duplication of attributes (vue/no-duplicate-attributes)

  • ⚙️ This rule is included in all of "plugin:vue/essential", "plugin:vue/strongly-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.

👎 Examples of incorrect code for this rule:

<MyComponent
  :foo="def"
  foo="abc"
/>

👍 Examples of correct code for this rule:

<MyComponent :foo="abc"/>
<MyComponent foo="abc"/>

🔧 Options

allowCoexistClass - Enables v-bind:class directive can coexist with the plain class attribute. allowCoexistStyle - Enables v-bind:style directive can coexist with the plain style attribute.

'vue/no-duplicate-attributes': [2, {
  allowCoexistClass: Boolean // default: true
  allowCoexistStyle: Boolean, // default: true
}]

TODO: <div foo foo></div>

parse5 remove duplicate attributes on the tokenization phase. Needs investigation to check.