From 90d0bd058d9f043b71bff42fe5fc38b5811962c4 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Tue, 17 Feb 2026 15:45:36 -0500 Subject: [PATCH] Extract rule: template-link-href-attributes --- README.md | 6 ++ docs/rules/template-link-href-attributes.md | 59 +++++++++++++++++++ lib/rules/template-link-href-attributes.js | 38 ++++++++++++ .../rules/template-link-href-attributes.js | 33 +++++++++++ 4 files changed, 136 insertions(+) create mode 100644 docs/rules/template-link-href-attributes.md create mode 100644 lib/rules/template-link-href-attributes.js create mode 100644 tests/lib/rules/template-link-href-attributes.js diff --git a/README.md b/README.md index 1997fcd7ea..99e9bed2f3 100644 --- a/README.md +++ b/README.md @@ -174,6 +174,12 @@ rules in templates can be disabled with eslint directives with mustache or html 🔧 Automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix).\ 💡 Manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions). +### Accessibility + +| Name | Description | 💼 | 🔧 | 💡 | +| :--------------------------------------------------------------------------- | :-------------------------------------- | :- | :- | :- | +| [template-link-href-attributes](docs/rules/template-link-href-attributes.md) | require href attribute on link elements | | | | + ### Best Practices | Name | Description | 💼 | 🔧 | 💡 | diff --git a/docs/rules/template-link-href-attributes.md b/docs/rules/template-link-href-attributes.md new file mode 100644 index 0000000000..f681172039 --- /dev/null +++ b/docs/rules/template-link-href-attributes.md @@ -0,0 +1,59 @@ +# ember/template-link-href-attributes + + + +Requires `href` attribute on `` 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 `