Skip to content

fix(lint): allow hr with role="presentation"#9028

Merged
ematipico merged 2 commits intobiomejs:mainfrom
LouisLau-art:fix/hr-presentation-role-9024
Feb 13, 2026
Merged

fix(lint): allow hr with role="presentation"#9028
ematipico merged 2 commits intobiomejs:mainfrom
LouisLau-art:fix/hr-presentation-role-9024

Conversation

@LouisLau-art
Copy link
Contributor

@LouisLau-art LouisLau-art commented Feb 11, 2026

Summary

  • allow hr with role="presentation" or role="none" in noInteractiveElementToNoninteractiveRole
  • keep the rule behavior unchanged for all other elements
  • add valid fixtures and update snapshots for this case

Closes #9024

Test

  • cargo test -p biome_js_analyze --test spec_tests specs::a11y::no_interactive_element_to_noninteractive_role

@changeset-bot
Copy link

changeset-bot bot commented Feb 11, 2026

🦋 Changeset detected

Latest commit: 99e4df0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 13 packages
Name Type
@biomejs/biome Patch
@biomejs/cli-win32-x64 Patch
@biomejs/cli-win32-arm64 Patch
@biomejs/cli-darwin-x64 Patch
@biomejs/cli-darwin-arm64 Patch
@biomejs/cli-linux-x64 Patch
@biomejs/cli-linux-arm64 Patch
@biomejs/cli-linux-x64-musl Patch
@biomejs/cli-linux-arm64-musl Patch
@biomejs/wasm-web Patch
@biomejs/wasm-bundler Patch
@biomejs/wasm-nodejs Patch
@biomejs/backend-jsonrpc Patch

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

@LouisLau-art LouisLau-art changed the title fix(lint): allow \ with \ fix(lint): allow hr with role="presentation" Feb 11, 2026
@github-actions github-actions bot added A-Linter Area: linter L-JavaScript Language: JavaScript and super languages labels Feb 11, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 11, 2026

Walkthrough

Adds a guard to the a11y rule noInteractiveElementToNoninteractiveRole to bypass validation when an hr element has role="presentation" or role="none". Two tests marking <hr role="presentation" /> and <hr role="none" /> as valid were added. No other rule logic or public API signatures were changed.

Suggested reviewers

  • dyc3
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Merge Conflict Detection ⚠️ Warning ❌ Merge conflicts detected (78 files):

⚔️ .claude/agents/biome-lint-engineer.md (content)
⚔️ .claude/agents/cst-parser-engineer.md (content)
⚔️ .claude/agents/ir-formatter-engineer.md (content)
⚔️ AGENTS.md (content)
⚔️ AGENTS.md~main (content)
⚔️ Cargo.lock (content)
⚔️ crates/biome_analyze/src/analyzer_plugin.rs (content)
⚔️ crates/biome_analyze/src/lib.rs (content)
⚔️ crates/biome_analyze/src/rule.rs (content)
⚔️ crates/biome_analyze/src/signals.rs (content)
⚔️ crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rs (content)
⚔️ crates/biome_cli/tests/commands/check.rs (content)
⚔️ crates/biome_configuration/Cargo.toml (content)
⚔️ crates/biome_configuration/src/analyzer/linter/rules.rs (content)
⚔️ crates/biome_css_analyze/Cargo.toml (content)
⚔️ crates/biome_css_formatter/Cargo.toml (content)
⚔️ crates/biome_css_parser/Cargo.toml (content)
⚔️ crates/biome_diagnostics_categories/src/categories.rs (content)
⚔️ crates/biome_graphql_formatter/Cargo.toml (content)
⚔️ crates/biome_graphql_parser/Cargo.toml (content)
⚔️ crates/biome_html_formatter/Cargo.toml (content)
⚔️ crates/biome_html_parser/Cargo.toml (content)
⚔️ crates/biome_js_analyze/Cargo.toml (content)
⚔️ crates/biome_js_analyze/src/lint/a11y/no_interactive_element_to_noninteractive_role.rs (content)
⚔️ crates/biome_js_analyze/src/lint/correctness/use_exhaustive_dependencies.rs (content)
⚔️ crates/biome_js_analyze/src/lint/style/use_naming_convention.rs (content)
⚔️ crates/biome_js_analyze/src/react.rs (content)
⚔️ crates/biome_js_analyze/tests/specs/a11y/noInteractiveElementToNoninteractiveRole/valid.jsx (content)
⚔️ crates/biome_js_analyze/tests/specs/a11y/noInteractiveElementToNoninteractiveRole/valid.jsx.snap (content)
⚔️ crates/biome_js_analyze/tests/specs/correctness/noUnusedImports/invalid-unused-react.jsx (content)
⚔️ crates/biome_js_analyze/tests/specs/correctness/noUnusedImports/invalid-unused-react.jsx.snap (content)
⚔️ crates/biome_js_analyze/tests/specs/correctness/noUnusedImports/valid-unused-react.jsx (content)
⚔️ crates/biome_js_analyze/tests/specs/correctness/noUnusedImports/valid-unused-react.jsx.snap (content)
⚔️ crates/biome_js_analyze/tests/specs/style/useImportType/valid-unused-react.tsx (content)
⚔️ crates/biome_js_analyze/tests/specs/style/useImportType/valid-unused-react.tsx.snap (content)
⚔️ crates/biome_js_formatter/Cargo.toml (content)
⚔️ crates/biome_js_parser/Cargo.toml (content)
⚔️ crates/biome_json_analyze/Cargo.toml (content)
⚔️ crates/biome_json_formatter/Cargo.toml (content)
⚔️ crates/biome_json_parser/Cargo.toml (content)
⚔️ crates/biome_lsp/src/server.tests.rs (content)
⚔️ crates/biome_lsp/src/session.rs (content)
⚔️ crates/biome_rule_options/src/lib.rs (content)
⚔️ crates/biome_service/src/workspace/server.rs (content)
⚔️ crates/biome_service/src/workspace/server.tests.rs (content)
⚔️ crates/biome_tailwind_parser/Cargo.toml (content)
⚔️ crates/biome_test_utils/Cargo.toml (content)
⚔️ crates/biome_test_utils/src/bench_case.rs (content)
⚔️ packages/@biomejs/backend-jsonrpc/CHANGELOG.md (content)
⚔️ packages/@biomejs/backend-jsonrpc/package.json (content)
⚔️ packages/@biomejs/backend-jsonrpc/src/workspace.ts (content)
⚔️ packages/@biomejs/biome/CHANGELOG.md (content)
⚔️ packages/@biomejs/biome/configuration_schema.json (content)
⚔️ packages/@biomejs/biome/package.json (content)
⚔️ packages/@biomejs/cli-darwin-arm64/CHANGELOG.md (content)
⚔️ packages/@biomejs/cli-darwin-arm64/package.json (content)
⚔️ packages/@biomejs/cli-darwin-x64/CHANGELOG.md (content)
⚔️ packages/@biomejs/cli-darwin-x64/package.json (content)
⚔️ packages/@biomejs/cli-linux-arm64-musl/CHANGELOG.md (content)
⚔️ packages/@biomejs/cli-linux-arm64-musl/package.json (content)
⚔️ packages/@biomejs/cli-linux-arm64/CHANGELOG.md (content)
⚔️ packages/@biomejs/cli-linux-arm64/package.json (content)
⚔️ packages/@biomejs/cli-linux-x64-musl/CHANGELOG.md (content)
⚔️ packages/@biomejs/cli-linux-x64-musl/package.json (content)
⚔️ packages/@biomejs/cli-linux-x64/CHANGELOG.md (content)
⚔️ packages/@biomejs/cli-linux-x64/package.json (content)
⚔️ packages/@biomejs/cli-win32-arm64/CHANGELOG.md (content)
⚔️ packages/@biomejs/cli-win32-arm64/package.json (content)
⚔️ packages/@biomejs/cli-win32-x64/CHANGELOG.md (content)
⚔️ packages/@biomejs/cli-win32-x64/package.json (content)
⚔️ packages/@biomejs/js-api/package.json (content)
⚔️ packages/@biomejs/wasm-bundler/CHANGELOG.md (content)
⚔️ packages/@biomejs/wasm-bundler/package.json (content)
⚔️ packages/@biomejs/wasm-nodejs/CHANGELOG.md (content)
⚔️ packages/@biomejs/wasm-nodejs/package.json (content)
⚔️ packages/@biomejs/wasm-web/CHANGELOG.md (content)
⚔️ packages/@biomejs/wasm-web/package.json (content)
⚔️ pnpm-lock.yaml (content)

These conflicts must be resolved before merging into main.
Resolve conflicts locally and push changes to this branch.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarises the main change: allowing hr elements with role="presentation" in the noInteractiveElementToNoninteractiveRole rule.
Description check ✅ Passed The description is directly related to the changeset, detailing the specific fix, test command, and issue closure.
Linked Issues check ✅ Passed The PR fully addresses issue #9024 by allowing hr elements with role="presentation" or role="none" per HTML/ARIA documentation, stopping the lint error for these valid role combinations.
Out of Scope Changes check ✅ Passed All changes are scoped to the issue: rule modification, test fixtures, and changeset documentation. The minor formatting change (blank line removal) is incidental to the main fix.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
⚔️ Resolve merge conflicts (beta)
  • Auto-commit resolved conflicts to branch fix/hr-presentation-role-9024
  • Post resolved changes as copyable diffs in a comment

No actionable comments were generated in the recent review. 🎉

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codspeed-hq
Copy link

codspeed-hq bot commented Feb 11, 2026

Merging this PR will not alter performance

✅ 58 untouched benchmarks
⏩ 95 skipped benchmarks1


Comparing LouisLau-art:fix/hr-presentation-role-9024 (99e4df0) with main (26d8367)

Open in CodSpeed

Footnotes

  1. 95 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@siketyan
Copy link
Member

Can you add a changeset to describe the change to users? See the contribution guide for details

@LouisLau-art
Copy link
Contributor Author

Added a changeset in 99e4df0 (.changeset/fix-hr-presentation-role.md). Thanks for the reminder.

@ematipico ematipico merged commit 5ac2ad6 into biomejs:main Feb 13, 2026
18 checks passed
@github-actions github-actions bot mentioned this pull request Feb 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Linter Area: linter L-JavaScript Language: JavaScript and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

💅 hr tag with role="presentation" throws lint/a11y/noInteractiveElementToNoninteractiveRole

3 participants