-
Notifications
You must be signed in to change notification settings - Fork 240
Add new rule no-duplicate-landmark-elements
#1550
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Simplify, simplify, simplify. Co-authored-by: Melanie Sumner <melaniersumner@gmail.com>
22d5b30
to
f1a77e9
Compare
lib/rules/require-landmark-labels.js
Outdated
@@ -0,0 +1,83 @@ | |||
'use strict'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe no-duplicate-landmark-elements
is a better name?
lib/rules/require-landmark-labels.js
Outdated
const ROLE_LANDMARK_MAP = { | ||
banner: 'header', | ||
main: 'main', | ||
complementary: 'aside', | ||
form: 'form', | ||
search: 'form', | ||
navigation: 'nav', | ||
contentinfo: 'footer', | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add an inline comment above here linking to the spec where this mapping is defined?
no-duplicate-landmark-elements
Co-authored-by: Rajasegar Chandran <rajasegar@users.noreply.github.com>
I think it's ready to go! 👍🏻 |
no-duplicate-landmark-elements
no-duplicate-landmark-elements
Hi @MelSumner I was wondering if you could help clear up some confusion we have about this rule. {{#if ....}}
<div role="alert">
Failed to build
</div>
{{else if .....}}
...
<p role="alert">{{message}}</p>
...
{{else}}
.....
<div role="alert">
{{#if explanationMessage}}
.... The rule will flag the multiple uses of Otherwise it seems like we would end up with |
This is a little bit of a different take on #1327 by @rajasegar
(I tried to commit to that branch but wasn't able to).