feat(js_analyze): implement noJsxNamespace#9913
Conversation
🦋 Changeset detectedLatest commit: 27d9a61 The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
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 |
8aba162 to
64db161
Compare
Merging this PR will not alter performance
Comparing Footnotes
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (9)
📒 Files selected for processing (6)
✅ Files skipped from review due to trivial changes (4)
🚧 Files skipped from review as they are similar to previous changes (2)
WalkthroughThis pull request adds a new nursery linter rule Suggested reviewers
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 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
⛔ Files ignored due to path filters (9)
crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rsis excluded by!**/migrate/eslint_any_rule_to_biome.rsand included by**crates/biome_configuration/src/analyzer/linter/rules.rsis excluded by!**/rules.rsand included by**crates/biome_configuration/src/generated/domain_selector.rsis excluded by!**/generated/**,!**/generated/**and included by**crates/biome_configuration/src/generated/linter_options_check.rsis excluded by!**/generated/**,!**/generated/**and included by**crates/biome_diagnostics_categories/src/categories.rsis excluded by!**/categories.rsand included by**crates/biome_js_analyze/tests/specs/nursery/noJsxNamespace/invalid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/nursery/noJsxNamespace/valid.jsx.snapis excluded by!**/*.snapand included by**packages/@biomejs/backend-jsonrpc/src/workspace.tsis excluded by!**/backend-jsonrpc/src/workspace.tsand included by**packages/@biomejs/biome/configuration_schema.jsonis excluded by!**/configuration_schema.jsonand included by**
📒 Files selected for processing (6)
.changeset/forty-lemons-stick.mdcrates/biome_js_analyze/src/lint/nursery/no_jsx_namespace.rscrates/biome_js_analyze/tests/specs/nursery/noJsxNamespace/invalid.jsxcrates/biome_js_analyze/tests/specs/nursery/noJsxNamespace/valid.jsxcrates/biome_rule_options/src/lib.rscrates/biome_rule_options/src/no_jsx_namespace.rs
e1a60c5 to
27d9a61
Compare
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