Skip to content

Latest commit

 

History

History
61 lines (43 loc) · 1.3 KB

File metadata and controls

61 lines (43 loc) · 1.3 KB

ember/template-no-duplicate-attributes

💼 This rule is enabled in the 📋 template-lint-migration config.

🔧 This rule is automatically fixable by the --fix CLI option.

Disallows duplicate attribute names in templates.

Duplicate attributes on the same element can lead to unexpected behavior and are often a mistake.

Rule Details

This rule disallows duplicate attributes on HTML elements, components, and helpers.

Examples

Examples of incorrect code for this rule:

<template>
  <div class="foo" class="bar"></div>
</template>
<template>
  <input type="text" disabled type="email" />
</template>
<template>
  {{helper foo="bar" foo="baz"}}
</template>

Examples of correct code for this rule:

<template>
  <div class="foo bar"></div>
</template>
<template>
  <input type="email" disabled />
</template>
<template>
  {{helper foo="bar" baz="qux"}}
</template>

References