Skip to content

Latest commit

 

History

History
46 lines (33 loc) · 1.13 KB

no-duplicate-attributes.md

File metadata and controls

46 lines (33 loc) · 1.13 KB

Disallow duplicate arguments (no-duplicate-attributes)

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:

<template>
    <div foo="abc" :foo="def"></div>
</template>

👍 Examples of correct code for this rule:

<template>
    <div foo="abc"></div>
    <div :foo="def"></div>
</template>

🔧 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/name-property-casing': [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.