fix(linter): treat separator role as non-interactive for hr elements#9039
fix(linter): treat separator role as non-interactive for hr elements#9039solssak wants to merge 1 commit intobiomejs:mainfrom
Conversation
The separator ARIA role inherits from both structure and widget, but per WAI-ARIA spec it is only interactive when focusable (with tabindex and aria-valuenow). A non-focusable separator like <hr> is a static structural element and should not trigger noInteractiveElementToNoninteractiveRole. Closes biomejs#9024
🦋 Changeset detectedLatest commit: 88d47b0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Closing as duplicate — @LouisLau-art already has PR #9028 for this. Apologies for the overlap! |
|
Caution Review failedThe pull request is closed. WalkthroughThis patch fixes the Suggested labels
Suggested reviewers
✨ Finishing touches
🧪 Generate unit tests (beta)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Fixes #9024.
<hr role="presentation">incorrectly triggersnoInteractiveElementToNoninteractiveRolebecause theseparatorrole (implicit role of<hr>) inherits fromwidget, causing it to be classified as interactive.Per the WAI-ARIA spec, the
separatorrole is only interactive when the element is focusable (e.g. hastabindexandaria-valuenow). A non-focusable<hr>is a static structural element.Changes
Separatorto the exception list inAriaRole::is_interactive()(same pattern as the existingProgressbarexception).<hr role="presentation" />and<hr role="none" />to valid test cases.Test plan
cargo test -p biome_js_analyze -- no_interactive_element_to_noninteractive_role— 2 passedcargo test -p biome_js_analyze -- no_noninteractive_element_to_interactive_role— 2 passedcargo test -p biome_aria_metadata— all passedAI assistance disclosure
This PR was authored with AI assistance (Claude Code) for codebase exploration, analysis, and implementation.