Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(biome_js_analyze): implement useFocusableInteractive #2710

Merged
merged 4 commits into from
May 9, 2024
Merged

feat(biome_js_analyze): implement useFocusableInteractive #2710

merged 4 commits into from
May 9, 2024

Conversation

DerTimonius
Copy link
Contributor

Summary

This PR adds the useFocusableInteractive rule which requires to add a tabIndex to non-interactive elements with interactive roles:

<div role="button" tabIndex={0} />
<div role="tab" tabIndex={0} />

So if the div has an interactive role, but no tabIndex, the rule shows an error!

Also there should not be false positives, meaning that adding a non-interactive role without a tabIndex should not show the error.

Test Plan

Added both valid.js and invalid.js tests

Closes #2611

@github-actions github-actions bot added A-CLI Area: CLI A-Project Area: project A-Linter Area: linter L-JavaScript Language: JavaScript and super languages A-Diagnostic Area: diagnostocis labels May 4, 2024
Copy link

codspeed-hq bot commented May 4, 2024

CodSpeed Performance Report

Merging #2710 will not alter performance

Comparing DerTimonius:feat/use-focusable-interactive (31a6ba6) with main (83a5c01)

Summary

✅ 84 untouched benchmarks

@ematipico ematipico merged commit 1309451 into biomejs:main May 9, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-CLI Area: CLI A-Diagnostic Area: diagnostocis A-Linter Area: linter A-Project Area: project L-JavaScript Language: JavaScript and super languages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

📎 Implement useFocusableInteractive - jsx-a11y/interactive-supports-focus
2 participants