Skip to content

Extract rule: template-no-duplicate-landmark-elements#2427

Merged
NullVoxPopuli merged 2 commits intoember-cli:masterfrom
NullVoxPopuli:nvp/template-lint-extract-rule-template-no-duplicate-landmark-elements
Mar 13, 2026
Merged

Extract rule: template-no-duplicate-landmark-elements#2427
NullVoxPopuli merged 2 commits intoember-cli:masterfrom
NullVoxPopuli:nvp/template-lint-extract-rule-template-no-duplicate-landmark-elements

Conversation

@NullVoxPopuli
Copy link
Copy Markdown
Contributor

Split from #2371.


- `header`
- `footer`
- `main`
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate main elements are invalid, even if they have aria-labels on it. Unless they have 'hidden' on it iirc.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you have any docs I can add the the md here about this?

Copy link
Copy Markdown


## References

- [ARIA Landmarks](https://www.w3.org/WAI/ARIA/apg/practices/landmark-regions/)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


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:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

});

ruleTester.run('template-no-duplicate-landmark-elements', rule, {
valid: [
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@NullVoxPopuli NullVoxPopuli force-pushed the nvp/template-lint-extract-rule-template-no-duplicate-landmark-elements branch 3 times, most recently from 15aa94c to e355692 Compare February 28, 2026 23:40
@NullVoxPopuli NullVoxPopuli force-pushed the nvp/template-lint-extract-rule-template-no-duplicate-landmark-elements branch from e355692 to a9e27db Compare March 10, 2026 22:27
@NullVoxPopuli NullVoxPopuli force-pushed the nvp/template-lint-extract-rule-template-no-duplicate-landmark-elements branch from a9e27db to 544b9f3 Compare March 13, 2026 21:15
@NullVoxPopuli NullVoxPopuli merged commit c034e44 into ember-cli:master Mar 13, 2026
11 checks passed
@NullVoxPopuli NullVoxPopuli deleted the nvp/template-lint-extract-rule-template-no-duplicate-landmark-elements branch March 13, 2026 21:46
NullVoxPopuli added a commit that referenced this pull request Mar 14, 2026
Post-merge review of #2427 (`template-no-duplicate-landmark-elements`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants