fix(a11y): useAriaPropsForRole no longer false-positives on Vue v-bind shorthand 🤖🤖🤖#10568
Conversation
🦋 Changeset detectedLatest commit: df5ad33 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 |
✅ Organic activityNo automation signals detected in the analyzed events. This is an automated analysis by AgentScan |
|
Worried about impact? Review this PR in Change Stack to explore blast radius before you approve or request changes. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (4)
WalkthroughThis PR fixes the Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Merging this PR will not alter performance
Comparing Footnotes
|
|
@dyc3 Thanks |
Fixes #10564
Summary
useAriaPropsForRolewas reporting false positives when required aria attributes were supplied via Vue v-bind shorthand syntax (:aria-checked="value",:aria-level="n", etc.).The rule checks for missing required aria props by calling
find_attribute_by_name, which only inspectsHtmlAttributenodes. Vue v-bind shorthands are parsed asVueVBindShorthandDirectivenodes with a structuredarg()field — not asHtmlAttributenodes — sofind_attribute_by_namealways returnedNonefor them, triggering a spurious diagnostic.Fix: replace
find_attribute_by_namewithfind_attribute_or_vue_binding, which already handles both plain html attributes and Vue v-bind directives. This is the same pattern used inuse_alt_text.rs.Test Plan
Added
valid.vuesnapshot test covering:aria-checked,:aria-level,:aria-selected,:aria-valuenow/min/max, and:aria-valuenowfor several roles (checkbox,radio,switch,heading,option,slider,meter). All 3 spec tests pass (invalid.html, valid.html, valid.vue).Docs
No documentation changes needed — rule behavior is unchanged for static attributes; this only removes a false positive for dynamic Vue bindings.