Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@rriski
Copy link
Contributor

@rriski rriski commented Dec 9, 2025

Add missing slots for JSX element patterns in GritQL.

The jsx_self_closing_element and jsx_opening_element patterns were missing slot definitions, preventing patterns like jsx_self_closing_element(name = "div") from working.

Changes

  • Add name, type_arguments, and attributes slots for jsx_self_closing_element
  • Add name, type_arguments, and attributes slots for jsx_opening_element
  • Consolidate jsx_attributes test into jsx_slots test

@changeset-bot
Copy link

changeset-bot bot commented Dec 9, 2025

🦋 Changeset detected

Latest commit: 10b472a

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 9, 2025

Walkthrough

Adds explicit slot mappings for legacy Tree-sitter JSX patterns: jsx_opening_element and jsx_self_closing_element now declare slots [("name", 1), ("type_arguments", 2), ("attributes", 3)]. Updates the codegen that emits those mappings and the generated mappings file. Adjusts TSX test specs and fixtures to exercise both legacy and native JSX patterns and adds a changelog entry.

Possibly related PRs

Suggested reviewers

  • ematipico

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix(grit): correct JSX element slot indices for GritQL patterns' directly and clearly summarises the main change—adding missing slot definitions for JSX elements in GritQL patterns.
Description check ✅ Passed The description accurately explains the problem, lists the specific slots added, and mentions test consolidation, all of which align with the changeset.
✨ 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 831c33e and 10b472a.

⛔ Files ignored due to path filters (2)
  • crates/biome_grit_patterns/tests/specs/tsx/jsx_attributes.snap is excluded by !**/*.snap and included by **
  • crates/biome_grit_patterns/tests/specs/tsx/jsx_slots.snap is excluded by !**/*.snap and included by **
📒 Files selected for processing (7)
  • .changeset/fix-jsx-slot-indices.md (1 hunks)
  • crates/biome_grit_patterns/src/grit_target_language/js_target_language/generated_mappings.rs (1 hunks)
  • crates/biome_grit_patterns/tests/specs/tsx/jsx_attributes.grit (0 hunks)
  • crates/biome_grit_patterns/tests/specs/tsx/jsx_attributes.tsx (0 hunks)
  • crates/biome_grit_patterns/tests/specs/tsx/jsx_slots.grit (1 hunks)
  • crates/biome_grit_patterns/tests/specs/tsx/jsx_slots.tsx (1 hunks)
  • xtask/codegen/src/generate_grit_mappings.rs (1 hunks)
💤 Files with no reviewable changes (2)
  • crates/biome_grit_patterns/tests/specs/tsx/jsx_attributes.grit
  • crates/biome_grit_patterns/tests/specs/tsx/jsx_attributes.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
  • crates/biome_grit_patterns/src/grit_target_language/js_target_language/generated_mappings.rs
  • .changeset/fix-jsx-slot-indices.md
🧰 Additional context used
📓 Path-based instructions (2)
**/*.tsx

📄 CodeRabbit inference engine (CONTRIBUTING.md)

For Node.js package development, build WebAssembly bindings and JSON-RPC bindings; run tests against compiled files after implementing features or bug fixes

Files:

  • crates/biome_grit_patterns/tests/specs/tsx/jsx_slots.tsx
**/*.rs

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.rs: Use the dbg!() macro for debugging output during testing, and pass the --show-output flag to cargo to view debug output
Use cargo t or cargo test to run tests; for a single test, pass the test name after the test command
Use snapshot testing with the insta crate; run cargo insta accept, cargo insta reject, or cargo insta review to manage snapshot changes
Write doctests as doc comments with code blocks; the code inside code blocks will be run during the testing phase
Use just f (alias for just format) to format Rust and TOML files before committing

Files:

  • xtask/codegen/src/generate_grit_mappings.rs
🧠 Learnings (6)
📚 Learning: 2025-11-28T09:08:10.091Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-28T09:08:10.091Z
Learning: Applies to **/*.tsx : For Node.js package development, build WebAssembly bindings and JSON-RPC bindings; run tests against compiled files after implementing features or bug fixes

Applied to files:

  • crates/biome_grit_patterns/tests/specs/tsx/jsx_slots.tsx
  • crates/biome_grit_patterns/tests/specs/tsx/jsx_slots.grit
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/tests/specs/**/*.{js,ts,tsx,jsx,json,css} : Test rules using snapshot tests via the `insta` library with test cases in `tests/specs/<group>/<rule_name>/` directories prefixed by `invalid` or `valid`

Applied to files:

  • crates/biome_grit_patterns/tests/specs/tsx/jsx_slots.tsx
  • crates/biome_grit_patterns/tests/specs/tsx/jsx_slots.grit
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/tests/specs/**/*.jsonc : Use `.jsonc` files in test specs with code snippets as array of strings to test rules in script environment (no import/export syntax)

Applied to files:

  • crates/biome_grit_patterns/tests/specs/tsx/jsx_slots.tsx
  • crates/biome_grit_patterns/tests/specs/tsx/jsx_slots.grit
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use language tags in documentation code blocks (js, ts, tsx, json, css) and order properties consistently as: language, then `expect_diagnostic`, then options modifiers, then `ignore`, then `file=path`

Applied to files:

  • crates/biome_grit_patterns/tests/specs/tsx/jsx_slots.tsx
  • xtask/codegen/src/generate_grit_mappings.rs
  • crates/biome_grit_patterns/tests/specs/tsx/jsx_slots.grit
📚 Learning: 2025-12-04T13:29:49.287Z
Learnt from: dyc3
Repo: biomejs/biome PR: 8291
File: crates/biome_html_formatter/tests/specs/prettier/vue/html-vue/elastic-header.html:10-10
Timestamp: 2025-12-04T13:29:49.287Z
Learning: Files under `crates/biome_html_formatter/tests/specs/prettier` are test fixtures synced from Prettier and should not receive detailed code quality reviews (e.g., HTTP vs HTTPS, formatting suggestions, etc.). These files are test data meant to validate formatter behavior and should be preserved as-is.

Applied to files:

  • crates/biome_grit_patterns/tests/specs/tsx/jsx_slots.tsx
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/tests/spec_tests.rs : Use the `tests_macros::gen_tests!` macro in `spec_tests.rs` to generate test functions for each specification file matching the pattern `tests/specs/<language>/**/*.<ext>`

Applied to files:

  • crates/biome_grit_patterns/tests/specs/tsx/jsx_slots.tsx
🧬 Code graph analysis (1)
crates/biome_grit_patterns/tests/specs/tsx/jsx_slots.tsx (1)
crates/biome_analyze/src/rule.rs (1)
  • span (1477-1479)
⏰ 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). (9)
  • GitHub Check: Parser conformance
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Documentation
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Check Dependencies
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: Test Node.js API
  • GitHub Check: autofix
🔇 Additional comments (3)
crates/biome_grit_patterns/tests/specs/tsx/jsx_slots.tsx (1)

1-7: Fixture nicely exercises the JSX surface area

This TSX snippet hits all the interesting cases you’re asserting on in jsx_slots.grit (names, attributes, type arguments, boolean attrs, children), without any unnecessary noise. Looks good as a focused fixture.

crates/biome_grit_patterns/tests/specs/tsx/jsx_slots.grit (1)

1-16: Spec cleanly covers both legacy and native JSX patterns

The or block gives tidy coverage for both the legacy jsx_* patterns (including the new name/type_arguments slots) and the native Jsx* nodes, and it lines up well with jsx_slots.tsx (opening <div>, various self‑closing elements, className, id, and style). This should regress‑proof the slot mapping change without over‑constraining the test.

xtask/codegen/src/generate_grit_mappings.rs (1)

286-293: JSX slot indices are correct for Biome's AST structure

The new slots for jsx_self_closing_element and jsx_opening_element match Biome's child node ordering: index 1 is name, index 2 is type_arguments, and index 3 is attributes. This unblocks queries like jsx_self_closing_element(name = "div") and properly handles generic type parameters in JSX. The fix is accurate for both node types.


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.

@github-actions github-actions bot added the L-Grit Language: GritQL label Dec 9, 2025
@rriski rriski force-pushed the fix/jsx-slot-indices branch 3 times, most recently from 58c344e to 4b170a4 Compare December 9, 2025 14:20
Copy link
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.

Actionable comments posted: 0

🧹 Nitpick comments (2)
.changeset/fix-jsx-slot-indices.md (2)

5-5: Use past tense for the description.

Per coding guidelines, describe what was done using past tense. Change "Fix" to "Fixes" or "Fixed".

-Fix incorrect slot indices for JSX elements in GritQL patterns.
+Fixes incorrect slot indices for JSX elements in GritQL patterns.

9-9: Slight redundancy with "adds...and adds".

Consider rephrasing to avoid the repeated verb.

-Also adds the missing `type_arguments` slot and adds slots for `JSX_ATTRIBUTE` (`name` and `initializer`).
+Adds the missing `type_arguments` slot and slots for `JSX_ATTRIBUTE` (`name` and `initializer`).
📜 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 ccf5e85 and 4b170a4.

📒 Files selected for processing (1)
  • .changeset/fix-jsx-slot-indices.md (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
.changeset/**/*.md

📄 CodeRabbit inference engine (CONTRIBUTING.md)

.changeset/**/*.md: Create changesets for user-facing changes using just new-changeset; use headers with #### or ##### only; keep descriptions concise (1-3 sentences) and focus on user-facing changes
Use past tense when describing what was done ('Added new feature'), present tense when describing Biome behavior ('Biome now supports'); end sentences with a full stop
For new lint rules, show an example of an invalid case in an inline code snippet or code block; for rule changes, demonstrate what is now invalid or valid; for formatter changes, use a diff code block

Files:

  • .changeset/fix-jsx-slot-indices.md
🪛 LanguageTool
.changeset/fix-jsx-slot-indices.md

[grammar] ~7-~7: Did you mean “indexed”?
Context: ...rectly mapped to index 2, but should be index 3 (after type_arguments at index 2). ...

(SHOULD_BE_DO)

⏰ 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). (2)
  • GitHub Check: Test Node.js API
  • GitHub Check: autofix

@rriski rriski force-pushed the fix/jsx-slot-indices branch from 4b170a4 to 66aa190 Compare December 9, 2025 14:23
@autofix-ci
Copy link
Contributor

autofix-ci bot commented Dec 9, 2025

Hi! I'm autofix logoautofix.ci, a bot that automatically fixes trivial issues such as code formatting in pull requests.

I would like to apply some automated changes to this pull request, but it looks like I don't have the necessary permissions to do so. To get this pull request into a mergeable state, please do one of the following two things:

  1. Allow edits by maintainers for your pull request, and then re-trigger CI (for example by pushing a new commit).
  2. Manually fix the issues identified for your pull request (see the GitHub Actions output for details on what I would like to change).

Copy link
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.

Actionable comments posted: 0

🧹 Nitpick comments (1)
crates/biome_grit_patterns/tests/specs/tsx/jsx_slots.grit (1)

3-14: Consider aligning legacy and native pattern tests.

The legacy and native patterns test slightly different element/attribute names ("span" vs "button", "className" vs "id"). Whilst this doesn't affect correctness, aligning them would make the parallel structure clearer.

Also note that type_arguments is only tested for jsx_self_closing_element (line 6) but not for jsx_opening_element. If opening elements can have type arguments, consider adding that test case as well.

📜 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 4b170a4 and 2e5594a.

⛔ Files ignored due to path filters (2)
  • crates/biome_grit_patterns/tests/specs/tsx/jsx_attributes.snap is excluded by !**/*.snap and included by **
  • crates/biome_grit_patterns/tests/specs/tsx/jsx_slots.snap is excluded by !**/*.snap and included by **
📒 Files selected for processing (5)
  • .changeset/fix-jsx-slot-indices.md (1 hunks)
  • crates/biome_grit_patterns/tests/specs/tsx/jsx_attributes.grit (0 hunks)
  • crates/biome_grit_patterns/tests/specs/tsx/jsx_attributes.tsx (0 hunks)
  • crates/biome_grit_patterns/tests/specs/tsx/jsx_slots.grit (1 hunks)
  • crates/biome_grit_patterns/tests/specs/tsx/jsx_slots.tsx (1 hunks)
💤 Files with no reviewable changes (2)
  • crates/biome_grit_patterns/tests/specs/tsx/jsx_attributes.tsx
  • crates/biome_grit_patterns/tests/specs/tsx/jsx_attributes.grit
🚧 Files skipped from review as they are similar to previous changes (2)
  • .changeset/fix-jsx-slot-indices.md
  • crates/biome_grit_patterns/tests/specs/tsx/jsx_slots.tsx
🧰 Additional context used
🧠 Learnings (5)
📓 Common learnings
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-28T09:08:10.091Z
Learning: Applies to **/*.tsx : For Node.js package development, build WebAssembly bindings and JSON-RPC bindings; run tests against compiled files after implementing features or bug fixes
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/tests/specs/**/*.{js,ts,tsx,jsx,json,css} : Test rules using snapshot tests via the `insta` library with test cases in `tests/specs/<group>/<rule_name>/` directories prefixed by `invalid` or `valid`

Applied to files:

  • crates/biome_grit_patterns/tests/specs/tsx/jsx_slots.grit
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/tests/specs/**/*.jsonc : Use `.jsonc` files in test specs with code snippets as array of strings to test rules in script environment (no import/export syntax)

Applied to files:

  • crates/biome_grit_patterns/tests/specs/tsx/jsx_slots.grit
📚 Learning: 2025-11-28T09:08:10.091Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-28T09:08:10.091Z
Learning: Applies to **/*.tsx : For Node.js package development, build WebAssembly bindings and JSON-RPC bindings; run tests against compiled files after implementing features or bug fixes

Applied to files:

  • crates/biome_grit_patterns/tests/specs/tsx/jsx_slots.grit
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use language tags in documentation code blocks (js, ts, tsx, json, css) and order properties consistently as: language, then `expect_diagnostic`, then options modifiers, then `ignore`, then `file=path`

Applied to files:

  • crates/biome_grit_patterns/tests/specs/tsx/jsx_slots.grit
⏰ 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). (8)
  • GitHub Check: Documentation
  • GitHub Check: Check Dependencies
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: End-to-end tests
  • GitHub Check: Test Node.js API
🔇 Additional comments (1)
crates/biome_grit_patterns/tests/specs/tsx/jsx_slots.grit (1)

1-15: Verify test coverage for the attributes slot.

The PR objectives mention adding name, type_arguments, and attributes slots, but I don't see an explicit test for the attributes slot (e.g., jsx_opening_element(attributes = ...) or jsx_self_closing_element(attributes = ...)). Lines 5 and 11-14 test individual attributes via jsx_attribute patterns, but not the attributes slot directly.

Please confirm whether the attributes slot requires explicit testing, or if the current attribute pattern tests are sufficient. If needed, consider adding patterns like:

jsx_opening_element(attributes = $attrs)

Additionally, verify that all added slots have corresponding test coverage before merging.

Copy link
Contributor

@dyc3 dyc3 left a comment

Choose a reason for hiding this comment

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

This doesn't actually change any behavior, it just changes tests.

@rriski
Copy link
Contributor Author

rriski commented Dec 9, 2025

This doesn't actually change any behavior, it just changes tests.

Sorry, was rebasing local branch and the actual fix got lost. Updated now.

@rriski rriski force-pushed the fix/jsx-slot-indices branch from 2e5594a to 831c33e Compare December 9, 2025 14:45
@github-actions github-actions bot added the A-Tooling Area: internal tools label Dec 9, 2025
Copy link
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.

Actionable comments posted: 0

🧹 Nitpick comments (1)
xtask/codegen/src/generate_grit_mappings.rs (1)

286-294: JSX TreeSitter slot indices are consistent with generated mappings

The added slots for the JSX self‑closing/opening patterns match the generated LegacyTreeSitterPattern entries and keep legacy vs native mappings in sync, so GritQL slot filters should now work as expected. If you’re ever bored, a tiny comment somewhere noting that 1=name, 2=type_arguments, 3=attributes come from the TreeSitter child order would save future archaeology—but that’s strictly optional.

📜 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 2e5594a and 831c33e.

⛔ Files ignored due to path filters (2)
  • crates/biome_grit_patterns/tests/specs/tsx/jsx_attributes.snap is excluded by !**/*.snap and included by **
  • crates/biome_grit_patterns/tests/specs/tsx/jsx_slots.snap is excluded by !**/*.snap and included by **
📒 Files selected for processing (7)
  • .changeset/fix-jsx-slot-indices.md (1 hunks)
  • crates/biome_grit_patterns/src/grit_target_language/js_target_language/generated_mappings.rs (1 hunks)
  • crates/biome_grit_patterns/tests/specs/tsx/jsx_attributes.grit (0 hunks)
  • crates/biome_grit_patterns/tests/specs/tsx/jsx_attributes.tsx (0 hunks)
  • crates/biome_grit_patterns/tests/specs/tsx/jsx_slots.grit (1 hunks)
  • crates/biome_grit_patterns/tests/specs/tsx/jsx_slots.tsx (1 hunks)
  • xtask/codegen/src/generate_grit_mappings.rs (1 hunks)
💤 Files with no reviewable changes (2)
  • crates/biome_grit_patterns/tests/specs/tsx/jsx_attributes.grit
  • crates/biome_grit_patterns/tests/specs/tsx/jsx_attributes.tsx
🚧 Files skipped from review as they are similar to previous changes (3)
  • crates/biome_grit_patterns/tests/specs/tsx/jsx_slots.grit
  • crates/biome_grit_patterns/tests/specs/tsx/jsx_slots.tsx
  • .changeset/fix-jsx-slot-indices.md
🧰 Additional context used
📓 Path-based instructions (1)
**/*.rs

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.rs: Use the dbg!() macro for debugging output during testing, and pass the --show-output flag to cargo to view debug output
Use cargo t or cargo test to run tests; for a single test, pass the test name after the test command
Use snapshot testing with the insta crate; run cargo insta accept, cargo insta reject, or cargo insta review to manage snapshot changes
Write doctests as doc comments with code blocks; the code inside code blocks will be run during the testing phase
Use just f (alias for just format) to format Rust and TOML files before committing

Files:

  • xtask/codegen/src/generate_grit_mappings.rs
  • crates/biome_grit_patterns/src/grit_target_language/js_target_language/generated_mappings.rs
🧠 Learnings (8)
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Use language tags in documentation code blocks (js, ts, tsx, json, css) and order properties consistently as: language, then `expect_diagnostic`, then options modifiers, then `ignore`, then `file=path`

Applied to files:

  • xtask/codegen/src/generate_grit_mappings.rs
  • crates/biome_grit_patterns/src/grit_target_language/js_target_language/generated_mappings.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : When formatting AST nodes, use mandatory tokens from the AST instead of hardcoding token strings (e.g., use `node.l_paren_token().format()` instead of `token("(")`)

Applied to files:

  • xtask/codegen/src/generate_grit_mappings.rs
  • crates/biome_grit_patterns/src/grit_target_language/js_target_language/generated_mappings.rs
📚 Learning: 2025-11-27T23:04:02.022Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-11-27T23:04:02.022Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/lint/**/*.rs : Set the `language` field in `declare_lint_rule!` to the primary language (js for JavaScript, jsx for JSX, ts for TypeScript, tsx for TSX) that the rule applies to

Applied to files:

  • xtask/codegen/src/generate_grit_mappings.rs
  • crates/biome_grit_patterns/src/grit_target_language/js_target_language/generated_mappings.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Do not attempt to 'fix' the code; if a token/node is known to be mandatory but is missing, return `None` instead

Applied to files:

  • xtask/codegen/src/generate_grit_mappings.rs
  • crates/biome_grit_patterns/src/grit_target_language/js_target_language/generated_mappings.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Distinguish between `TypeData::Unknown` and `TypeData::UnknownKeyword` to measure inference effectiveness versus explicit user-provided unknown types

Applied to files:

  • crates/biome_grit_patterns/src/grit_target_language/js_target_language/generated_mappings.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Use `TypeReference` instead of `Arc` for types that reference other types to avoid stale cache issues when modules are replaced

Applied to files:

  • crates/biome_grit_patterns/src/grit_target_language/js_target_language/generated_mappings.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Store type data in linear vectors instead of using recursive data structures with `Arc` for improved data locality and performance

Applied to files:

  • crates/biome_grit_patterns/src/grit_target_language/js_target_language/generated_mappings.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : For tokens that are not mandatory, use helper functions instead of hardcoding

Applied to files:

  • crates/biome_grit_patterns/src/grit_target_language/js_target_language/generated_mappings.rs
⏰ 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). (10)
  • GitHub Check: End-to-end tests
  • GitHub Check: Documentation
  • GitHub Check: Check Dependencies
  • GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: autofix
  • GitHub Check: Parser conformance
  • GitHub Check: Test Node.js API
🔇 Additional comments (1)
crates/biome_grit_patterns/src/grit_target_language/js_target_language/generated_mappings.rs (1)

138-146: Legacy JSX slots now wired correctly

The new slots entries for the legacy JSX self‑closing/opening elements line up with the generator definitions and will make queries like jsx_self_closing_element(name = "div") and jsx_opening_element(name = "div") behave as advertised. Nothing to nitpick here.

Add name, type_arguments, and attributes slots for jsx_self_closing_element
and jsx_opening_element patterns. This enables patterns like:

  jsx_self_closing_element(name = "div")
  jsx_opening_element(type_arguments = TsTypeArguments())

Consolidates jsx_attributes test into jsx_slots test.
@rriski rriski force-pushed the fix/jsx-slot-indices branch from 831c33e to 10b472a Compare December 9, 2025 16:13
@rriski rriski requested review from dyc3 and ematipico December 9, 2025 16:36
@ematipico ematipico merged commit 9f1b3b0 into biomejs:main Dec 9, 2025
14 checks passed
This was referenced Dec 9, 2025
l0ngvh pushed a commit to l0ngvh/biome that referenced this pull request Dec 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Tooling Area: internal tools L-Grit Language: GritQL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants