Skip to content

fix(no_unknown_attribute): added support for new dom attributes#8064

Merged
dyc3 merged 2 commits intobiomejs:mainfrom
dibashthapa:fix-svg-properties
Nov 10, 2025
Merged

fix(no_unknown_attribute): added support for new dom attributes#8064
dyc3 merged 2 commits intobiomejs:mainfrom
dibashthapa:fix-svg-properties

Conversation

@dibashthapa
Copy link
Contributor

I tried using Chatgpt to add new properties. But then I manually copied from Eslint React codebase.

Summary

Fixes : #7967

Test Plan

Added new svg element in valid.jsx file for testing opacity attribute

Docs

@changeset-bot
Copy link

changeset-bot bot commented Nov 10, 2025

🦋 Changeset detected

Latest commit: 02c520e

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 Nov 10, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 10, 2025

Walkthrough

This change expands SVG and DOM property support in the Biome linter. It updates the DOM property recognition list to include additional single-word and two-word properties, re-enables xlink:href attribute validation in JSX tests, and adds new SVG test cases with path elements. A corresponding changeset marks this as a patch release fixing advanced SVG props support.

Suggested reviewers

  • ematipico
  • dyc3

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarises the main change: expanding DOM attribute support in the no_unknown_attribute linter rule to fix SVG property handling.
Description check ✅ Passed The description clearly relates to the changeset, explaining the motivation (fixing issue #7967), the approach (adding new properties), and the testing approach (SVG element with opacity attribute).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5f68bcc and 02c520e.

⛔ Files ignored due to path filters (1)
  • crates/biome_js_analyze/tests/specs/nursery/noUnknownAttribute/valid.jsx.snap is excluded by !**/*.snap and included by **
📒 Files selected for processing (3)
  • .changeset/grumpy-pants-repeat.md (1 hunks)
  • crates/biome_js_analyze/src/lint/nursery/no_unknown_attribute.rs (8 hunks)
  • crates/biome_js_analyze/tests/specs/nursery/noUnknownAttribute/valid.jsx (2 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-15T09:23:33.055Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:23:33.055Z
Learning: Applies to crates/biome_js_type_info/src/type_info.rs : Add new TypeScript type support by extending the TypeData enum rather than introducing parallel structures.

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/no_unknown_attribute.rs
🪛 LanguageTool
.changeset/grumpy-pants-repeat.md

[style] ~5-~5: Consider using a different verb for a more formal wording.
Context: .../github.com//issues/7967): Fixed the issue with support for advanced SVG...

(FIX_RESOLVE)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: Test Node.js API
  • GitHub Check: Bench (biome_js_parser)
  • GitHub Check: Bench (biome_js_analyze)
  • GitHub Check: Bench (biome_js_formatter)
  • GitHub Check: autofix
🔇 Additional comments (3)
.changeset/grumpy-pants-repeat.md (1)

1-5: Changeset looks good.

The patch release note is clear and properly formatted. The static analysis suggestion about wording is purely stylistic—"Fixed" works perfectly well here.

crates/biome_js_analyze/tests/specs/nursery/noUnknownAttribute/valid.jsx (2)

10-10: Good addition.

Enabling the xlink:href test case properly validates the expanded namespace attribute support.


48-54: Nice test coverage for the opacity attribute.

This directly addresses the issue from #7967 and validates the expanded SVG property support.


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 Nov 10, 2025

CodSpeed Performance Report

Merging #8064 will not alter performance

Comparing dibashthapa:fix-svg-properties (02c520e) with main (dc1217c)1

Summary

✅ 58 untouched
⏩ 85 skipped2

Footnotes

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

  2. 85 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.

@dyc3 dyc3 merged commit 3ff9d45 into biomejs:main Nov 10, 2025
18 checks passed
@github-actions github-actions bot mentioned this pull request Nov 10, 2025
ematipico pushed a commit to hamirmahal/biome that referenced this pull request Nov 19, 2025
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.

💅 noUnknownAttribute doesn't support SVG opacity

2 participants