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

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .changeset/wicked-bushes-scream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"@biomejs/biome": patch
---

Fixed [#8079](https://github.com/biomejs/biome/issues/8079): Properly handle `name` and `value` metavariables for `JsxAttribute` GritQL queries.

The following `biome search` command no longer throws an error:

```
biome search 'JsxAttribute($name, $value) as $attr where { $name <: "style" }'
```
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ pub const LEGACY_TREESITTER_COMPATIBILITY_PATTERNS: &[LegacyTreeSitterPattern] =
LegacyTreeSitterPattern {
name: "jsx_attribute",
kind: JsSyntaxKind::JSX_ATTRIBUTE,
slots: &[],
slots: &[("name", 0), ("value", 1)],
},
LegacyTreeSitterPattern {
name: "jsx_element",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
JsxAttribute($name, $value) as $attr where {
$name <: "style"
}
12 changes: 12 additions & 0 deletions crates/biome_grit_patterns/tests/specs/tsx/jsx_attributes.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
source: crates/biome_grit_patterns/tests/spec_tests.rs
expression: jsx_attributes
---
SnapshotResult {
messages: [],
matched_ranges: [
"1:6-1:16",
],
rewritten_files: [],
created_files: [],
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<div style={{}}>{children}</div>;
2 changes: 1 addition & 1 deletion xtask/codegen/src/generate_grit_mappings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ const JS_TREESITTER_PATTERNS: &[TreeSitterPattern] = &[
TreeSitterPattern {
name: "jsx_attribute",
biome_kind: "JSX_ATTRIBUTE",
slots: &[],
slots: &[("name", 0), ("value", 1)],
},
TreeSitterPattern {
name: "jsx_element",
Expand Down
Loading