ember/template-no-duplicate-attributes
April 20, 2026 ยท View on GitHub
๐ผ 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>