fix: template-no-invalid-aria-attributes — skip custom elements (hyphenated tags)#34
Closed
johanrd wants to merge 3 commits into
Closed
fix: template-no-invalid-aria-attributes — skip custom elements (hyphenated tags)#34johanrd wants to merge 3 commits into
johanrd wants to merge 3 commits into
Conversation
…enated tags) HTML custom elements (tags with a hyphen, per WHATWG valid-custom-element-name) define their own a11y contracts; they may intentionally use aria-* attributes whose validity depends on the component's shadow-DOM-mapped role, which ESLint cannot introspect. Our rule previously flagged aria-* on every tag, producing false positives for these patterns. Skip the check when node.tag is a custom element (lowercase + hyphen). Matches angular-eslint's valid-aria behavior. Ref: audit tracking PR #28 item G6.
🏎️ Benchmark Comparison
Full mitata output |
Translates 94 cases from peer-plugin rules: - jsx-a11y aria-props - vuejs-accessibility aria-props - lit-a11y aria-unsupported-elements / valid-aria-* - @angular-eslint/template valid-aria Fixture documents parity after this fix: custom elements (hyphenated tags) now skip the check. jsx-a11y has no equivalent concept and would still flag `<app-custom aria-x="text">`, which is documented inline.
Owner
Author
|
Moved upstream to ember-cli#2732. See that PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fix: skip the check when
node.tagis a custom element (lowercase + hyphen). Matches angular-eslint'svalid-ariabehavior.Ref: audit tracking PR #28 item G6.
Note: no
audit/phase3/aria-propsfixture currently exists on master — thetests/audit/aria-props/peer-parity.jsaudit fixture referenced in the finding (B9 DIVERGENCE #1) will need updating separately on its branch.