Skip to content

fix(linter): support SolidJS's innerHTML in useAnchorContent#9324

Merged
arendjr merged 1 commit intobiomejs:mainfrom
arendjr:use-anchor-content-supports-solid-js-inner-html
Mar 4, 2026
Merged

fix(linter): support SolidJS's innerHTML in useAnchorContent#9324
arendjr merged 1 commit intobiomejs:mainfrom
arendjr:use-anchor-content-supports-solid-js-inner-html

Conversation

@arendjr
Copy link
Copy Markdown
Contributor

@arendjr arendjr commented Mar 4, 2026

Summary

Fixed #7730: useAnchorContent now recognises SolidJS's innerHTML the same way as React's dangerouslySetInnerHTML.

Test Plan

Testcase added and snapshots updated.

Docs

Let this one be a happy surprise when things "just work" :)

Summary by CodeRabbit

Bug Fixes

  • Fixed the useAnchorContent linting rule to properly recognize the innerHTML attribute as valid anchor content, improving compatibility with SolidJS applications and aligning behavior across different frameworks.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 4, 2026

🦋 Changeset detected

Latest commit: 7f5aff1

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

@github-actions github-actions bot added A-Linter Area: linter L-JavaScript Language: JavaScript and super languages labels Mar 4, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 4, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 38ed4cad-5c64-46ab-9387-4abc02b5ed94

📥 Commits

Reviewing files that changed from the base of the PR and between 1022662 and 7f5aff1.

⛔ Files ignored due to path filters (1)
  • crates/biome_js_analyze/tests/specs/a11y/useAnchorContent/valid.jsx.snap is excluded by !**/*.snap
📒 Files selected for processing (3)
  • .changeset/happy-hipsters-celebrate.md
  • crates/biome_js_analyze/src/lint/a11y/use_anchor_content.rs
  • crates/biome_js_analyze/tests/specs/a11y/useAnchorContent/valid.jsx

📝 Walkthrough

Walkthrough

This pull request fixes the useAnchorContent linting rule to treat the innerHTML attribute (used in SolidJS) as valid anchor content, consistent with how dangerouslySetInnerHTML is treated in React. The fix includes a logic update to the rule implementation and a corresponding test case.

Changes

Cohort / File(s) Summary
Changeset Documentation
.changeset/happy-hipsters-celebrate.md
Patch release entry documenting the fix for issue #7730 regarding innerHTML support in useAnchorContent rule.
Rule Implementation & Tests
crates/biome_js_analyze/src/lint/a11y/use_anchor_content.rs, crates/biome_js_analyze/tests/specs/a11y/useAnchorContent/valid.jsx
Added innerHTML attribute validation to the anchor content check, enabling SolidJS components with innerHTML props to pass linting without false positives. Includes test case demonstrating the fix.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • ematipico
  • dyc3

Poem

🐰 A fix so fine, innerHTML's now the way,
SolidJS anchors no longer lead astray,
Content is valid, the rule's now more fair,
React and Solid both dancing with care! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: supporting SolidJS's innerHTML in the useAnchorContent linter rule, which directly aligns with the PR's objective to fix issue #7730.
Linked Issues check ✅ Passed The PR successfully implements the required changes to treat SolidJS innerHTML as valid content, updates the rule logic, adds test cases, and documents the fix in the changeset.
Out of Scope Changes check ✅ Passed All changes are directly related to fixing issue #7730: updating the lint rule, adding test cases, and documenting the fix in the changeset.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ 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

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

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 4, 2026

Merging this PR will not alter performance

✅ 58 untouched benchmarks
⏩ 156 skipped benchmarks1


Comparing arendjr:use-anchor-content-supports-solid-js-inner-html (7f5aff1) with main (40869b5)2

Open in CodSpeed

Footnotes

  1. 156 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.

  2. No successful run was found on main (1022662) during the generation of this report, so 40869b5 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@arendjr arendjr merged commit 6294aa2 into biomejs:main Mar 4, 2026
19 checks passed
@github-actions github-actions bot mentioned this pull request Mar 4, 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.

💅 useAnchorContent incorrectly flags SolidJs components with innerHTML prop

1 participant