Fix and rename LandmarkHasLabel rule to NavigationHasLabel #64
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes: https://github.com/github/accessibility/issues/3290
This is a lint rule that was written before our teams time that looks like we need to revisit.
This appears to be flagging all
<aside>
,<nav>
, and<section>
without an accessible name.Flagging
<section>
seems incorrect since we don’t know if the<section>
is intended to be a landmark. A<section>
only becomes a region landmark if its labelled, but we don't know if the developer intends it to be.Similarly, I am not sure we about flagging
<aside>
.I think it makes sense to enforce a navigation landmark to have an accessible name given that GitHub sites usually have multiple navigation and it would help for those to be labelled.
I am simplifying this rule significantly from what it is currently doing so it only flag:
nav
orrole="navigation"
has no label.nav
ifrole="navigation"
is being used.Consequently, I renamed the rule to be
NavigationHasLabel
. If we decide we want to add more enforcements around landmark, it should be a more scoped rule.