Extract rule: template-no-duplicate-landmark-elements#2427
Conversation
|
|
||
| - `header` | ||
| - `footer` | ||
| - `main` |
There was a problem hiding this comment.
Duplicate main elements are invalid, even if they have aria-labels on it. Unless they have 'hidden' on it iirc.
There was a problem hiding this comment.
do you have any docs I can add the the md here about this?
There was a problem hiding this comment.
A document mustn't have more than one <main element that doesn't have the hidden attribute specified.
|
|
||
| ## References | ||
|
|
||
| - [ARIA Landmarks](https://www.w3.org/WAI/ARIA/apg/practices/landmark-regions/) |
There was a problem hiding this comment.
These docs have lost references from the original https://github.com/ember-template-lint/ember-template-lint/blob/main/docs/rule/no-duplicate-landmark-elements.md
|
|
||
| This rule ensures that when multiple landmark elements of the same type appear in a template, each has a unique `aria-label` or `aria-labelledby` attribute. | ||
|
|
||
| Landmark elements checked: |
There was a problem hiding this comment.
The original rule does not include section and also specifies roles: https://github.com/ember-template-lint/ember-template-lint/blob/main/docs/rule/no-duplicate-landmark-elements.md#no-duplicate-landmark-elements
| }); | ||
|
|
||
| ruleTester.run('template-no-duplicate-landmark-elements', rule, { | ||
| valid: [ |
There was a problem hiding this comment.
I'd feel better if this took all the valid/invalid examples from the original test: https://github.com/ember-template-lint/ember-template-lint/blob/main/test/unit/rules/no-duplicate-landmark-elements-test.js
15aa94c to
e355692
Compare
e355692 to
a9e27db
Compare
a9e27db to
544b9f3
Compare
Post-merge review of #2427 (`template-no-duplicate-landmark-elements`)
Split from #2371.