Skip to content

feat(js_analyze): implement noJsxNamespace#9913

Merged
Netail merged 1 commit intobiomejs:mainfrom
Netail:feat/no-jsx-namespace
Apr 11, 2026
Merged

feat(js_analyze): implement noJsxNamespace#9913
Netail merged 1 commit intobiomejs:mainfrom
Netail:feat/no-jsx-namespace

Conversation

@Netail
Copy link
Copy Markdown
Member

@Netail Netail commented Apr 11, 2026

Summary

Port https://www.eslint-react.xyz/docs/rules/jsx-no-namespace, which disallow JSX namespace syntax.

Partially generated by co-pilot

Test Plan

Unit tests

Docs

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 11, 2026

🦋 Changeset detected

Latest commit: 27d9a61

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 A-Diagnostic Area: diagnostocis labels Apr 11, 2026
@Netail Netail force-pushed the feat/no-jsx-namespace branch from 8aba162 to 64db161 Compare April 11, 2026 01:00
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 11, 2026

Merging this PR will not alter performance

✅ 58 untouched benchmarks
⏩ 196 skipped benchmarks1


Comparing Netail:feat/no-jsx-namespace (27d9a61) with main (e7775a5)

Open in CodSpeed

Footnotes

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

@github-actions github-actions Bot added A-CLI Area: CLI A-Project Area: project labels Apr 11, 2026
@Netail Netail marked this pull request as ready for review April 11, 2026 01:25
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 11, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f72359d7-db56-41de-981c-9af8255f6cb7

📥 Commits

Reviewing files that changed from the base of the PR and between e1a60c5 and 27d9a61.

⛔ Files ignored due to path filters (9)
  • crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rs is excluded by !**/migrate/eslint_any_rule_to_biome.rs and included by **
  • crates/biome_configuration/src/analyzer/linter/rules.rs is excluded by !**/rules.rs and included by **
  • crates/biome_configuration/src/generated/domain_selector.rs is excluded by !**/generated/**, !**/generated/** and included by **
  • crates/biome_configuration/src/generated/linter_options_check.rs is excluded by !**/generated/**, !**/generated/** and included by **
  • crates/biome_diagnostics_categories/src/categories.rs is excluded by !**/categories.rs and included by **
  • crates/biome_js_analyze/tests/specs/nursery/noJsxNamespace/invalid.jsx.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/noJsxNamespace/valid.jsx.snap is excluded by !**/*.snap and included by **
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts is excluded by !**/backend-jsonrpc/src/workspace.ts and included by **
  • packages/@biomejs/biome/configuration_schema.json is excluded by !**/configuration_schema.json and included by **
📒 Files selected for processing (6)
  • .changeset/forty-lemons-stick.md
  • crates/biome_js_analyze/src/lint/nursery/no_jsx_namespace.rs
  • crates/biome_js_analyze/tests/specs/nursery/noJsxNamespace/invalid.jsx
  • crates/biome_js_analyze/tests/specs/nursery/noJsxNamespace/valid.jsx
  • crates/biome_rule_options/src/lib.rs
  • crates/biome_rule_options/src/no_jsx_namespace.rs
✅ Files skipped from review due to trivial changes (4)
  • crates/biome_js_analyze/tests/specs/nursery/noJsxNamespace/invalid.jsx
  • .changeset/forty-lemons-stick.md
  • crates/biome_js_analyze/tests/specs/nursery/noJsxNamespace/valid.jsx
  • crates/biome_rule_options/src/no_jsx_namespace.rs
🚧 Files skipped from review as they are similar to previous changes (2)
  • crates/biome_rule_options/src/lib.rs
  • crates/biome_js_analyze/src/lint/nursery/no_jsx_namespace.rs

Walkthrough

This pull request adds a new nursery linter rule noJsxNamespace to Biome's JavaScript analyser. It flags JSX namespace syntax (for example <ns:component />) as unsupported by React. Changes include the lint rule implementation, an empty options type NoJsxNamespaceOptions, test fixtures for valid and invalid JSX examples, and a changeset for a patch release.

Suggested reviewers

  • ematipico
  • dyc3
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat(js_analyze): implement noJsxNamespace' accurately describes the main change—implementing a new linter rule for disallowing JSX namespace syntax.
Description check ✅ Passed The description is directly related to the changeset, explaining the rule's origin (ESLint React port) and test approach, though documentation is acknowledged as pending.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
crates/biome_js_analyze/tests/specs/nursery/noJsxNamespace/invalid.jsx (1)

5-9: Consider one paired-tag invalid case for extra coverage.

You already cover self-closing forms well. Adding something like <ns:Comp></ns:Comp> would harden regressions around opening/closing element handling.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@crates/biome_js_analyze/tests/specs/nursery/noJsxNamespace/invalid.jsx`
around lines 5 - 9, Add a paired-tag invalid case to the existing invalid JSX
examples (alongside the existing <ns:testcomponent />, <ns:testComponent />,
<Ns:TestComponent />, <svg:circle /> entries) by inserting a namespaced opening
and closing element pair such as <ns:Comp></ns:Comp> to exercise opening/closing
element handling and ensure mismatched paired-tag regressions are covered; place
it with the other test entries in the same block so the parser sees a
non-self-closing namespaced element.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@crates/biome_js_analyze/tests/specs/nursery/noJsxNamespace/invalid.jsx`:
- Around line 5-9: Add a paired-tag invalid case to the existing invalid JSX
examples (alongside the existing <ns:testcomponent />, <ns:testComponent />,
<Ns:TestComponent />, <svg:circle /> entries) by inserting a namespaced opening
and closing element pair such as <ns:Comp></ns:Comp> to exercise opening/closing
element handling and ensure mismatched paired-tag regressions are covered; place
it with the other test entries in the same block so the parser sees a
non-self-closing namespaced element.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 675379d0-7546-439b-909a-3512b5ee26fd

📥 Commits

Reviewing files that changed from the base of the PR and between e7775a5 and e1a60c5.

⛔ Files ignored due to path filters (9)
  • crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rs is excluded by !**/migrate/eslint_any_rule_to_biome.rs and included by **
  • crates/biome_configuration/src/analyzer/linter/rules.rs is excluded by !**/rules.rs and included by **
  • crates/biome_configuration/src/generated/domain_selector.rs is excluded by !**/generated/**, !**/generated/** and included by **
  • crates/biome_configuration/src/generated/linter_options_check.rs is excluded by !**/generated/**, !**/generated/** and included by **
  • crates/biome_diagnostics_categories/src/categories.rs is excluded by !**/categories.rs and included by **
  • crates/biome_js_analyze/tests/specs/nursery/noJsxNamespace/invalid.jsx.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/noJsxNamespace/valid.jsx.snap is excluded by !**/*.snap and included by **
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts is excluded by !**/backend-jsonrpc/src/workspace.ts and included by **
  • packages/@biomejs/biome/configuration_schema.json is excluded by !**/configuration_schema.json and included by **
📒 Files selected for processing (6)
  • .changeset/forty-lemons-stick.md
  • crates/biome_js_analyze/src/lint/nursery/no_jsx_namespace.rs
  • crates/biome_js_analyze/tests/specs/nursery/noJsxNamespace/invalid.jsx
  • crates/biome_js_analyze/tests/specs/nursery/noJsxNamespace/valid.jsx
  • crates/biome_rule_options/src/lib.rs
  • crates/biome_rule_options/src/no_jsx_namespace.rs

@Netail Netail force-pushed the feat/no-jsx-namespace branch from e1a60c5 to 27d9a61 Compare April 11, 2026 01:43
@Netail Netail merged commit d417803 into biomejs:main Apr 11, 2026
21 checks passed
@Netail Netail deleted the feat/no-jsx-namespace branch April 11, 2026 14:34
@github-actions github-actions Bot mentioned this pull request Apr 11, 2026
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.

2 participants