Rule proposal: Allow routerLink only on "a" tags (Accessibility) #1545
json-derulo
started this conversation in
New Rule Proposals
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Angular allows their
routerLink
directive on many HTML elements, likea
,button
ordiv
. However putting this directive to any other element thana
has many drawbacks:div
), the element is selectable with the keyboard (because Angular addstabindex="0"
), however there is no way to "click" the link with the keyboard in order to trigger the navigationMy proposal is to add a new rule
@angular-eslint/template/prefer-router-link-a
. Whenever therouterLink
directive is used on any other element thana
, an error is raised.Beta Was this translation helpful? Give feedback.
All reactions