💼 This rule is enabled in the 📋 template-lint-migration config.
Requires href attribute on <a> elements.
Anchor elements should have an href attribute to be properly recognized as links by browsers and assistive technologies. If an element is meant to be interactive but not navigate, use a <button> instead.
This rule ensures that all <a> elements have an href attribute.
Examples of incorrect code for this rule:
<template>
<a>Link</a>
</template><template>
<a onclick={{this.handleClick}}>Click me</a>
</template><template>
<a role="button">Action</a>
</template>Examples of correct code for this rule:
<template>
<a href="/about">About Us</a>
</template><template>
<a href="https://example.com">External Link</a>
</template><template>
<button {{on "click" this.handleClick}}>Click me</button>
</template>