-
-
Notifications
You must be signed in to change notification settings - Fork 481
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(deserialize): unescape JSON strings (#3414)
Co-authored-by: Emanuele Stoppa <[email protected]>
- Loading branch information
Showing
8 changed files
with
162 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
crates/biome_js_analyze/tests/specs/style/useNamingConvention/invalidCustomRegexAnchor.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"$schema": "../../../../../../packages/@biomejs/biome/configuration_schema.json", | ||
"linter": { | ||
"rules": { | ||
"style": { | ||
"useNamingConvention": { | ||
"level": "error", | ||
"options": { | ||
"conventions": [ | ||
{ | ||
"selector": { | ||
"kind": "const" | ||
}, | ||
"match": "(.*?)[$]?", | ||
"formats": ["camelCase"] | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
...s/biome_js_analyze/tests/specs/style/useNamingConvention/invalidCustomRegexAnchor.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--- | ||
source: crates/biome_js_analyze/tests/spec_tests.rs | ||
expression: invalidCustomRegexAnchor.js | ||
--- | ||
# Input | ||
```jsx | ||
{ | ||
"$schema": "../../../../../../packages/@biomejs/biome/configuration_schema.json", | ||
"linter": { | ||
"rules": { | ||
"style": { | ||
"useNamingConvention": { | ||
"level": "error", | ||
"options": { | ||
"conventions": [ | ||
{ | ||
"selector": { | ||
"kind": "const" | ||
}, | ||
"match": "(.*?)[$]?", | ||
"formats": ["camelCase"] | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
``` | ||
|
||
# Diagnostics | ||
``` | ||
invalidCustomRegexAnchor.options:14:18 deserialize ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | ||
× Anchors `^` and `$` are not supported. They are implciitly present. | ||
12 │ "kind": "const" | ||
13 │ }, | ||
> 14 │ "match": "(.*?)$", | ||
│ ^^^^^^^^ | ||
15 │ "formats": ["camelCase"] | ||
16 │ } | ||
``` |
23 changes: 23 additions & 0 deletions
23
...me_js_analyze/tests/specs/style/useNamingConvention/invalidCustomRegexAnchor.options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"$schema": "../../../../../../packages/@biomejs/biome/configuration_schema.json", | ||
"linter": { | ||
"rules": { | ||
"style": { | ||
"useNamingConvention": { | ||
"level": "error", | ||
"options": { | ||
"conventions": [ | ||
{ | ||
"selector": { | ||
"kind": "const" | ||
}, | ||
"match": "(.*?)$", | ||
"formats": ["camelCase"] | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...es/biome_js_analyze/tests/specs/style/useNamingConvention/validCustomStyleDollarSuffix.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
const x$ = 0; |
8 changes: 8 additions & 0 deletions
8
...ome_js_analyze/tests/specs/style/useNamingConvention/validCustomStyleDollarSuffix.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
source: crates/biome_js_analyze/tests/spec_tests.rs | ||
expression: validCustomStyleDollarSuffix.js | ||
--- | ||
# Input | ||
```jsx | ||
const x$ = 0; | ||
``` |
23 changes: 23 additions & 0 deletions
23
...s_analyze/tests/specs/style/useNamingConvention/validCustomStyleDollarSuffix.options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"$schema": "../../../../../../packages/@biomejs/biome/configuration_schema.json", | ||
"linter": { | ||
"rules": { | ||
"style": { | ||
"useNamingConvention": { | ||
"level": "error", | ||
"options": { | ||
"conventions": [ | ||
{ | ||
"selector": { | ||
"kind": "const" | ||
}, | ||
"match": "(.*?)\\$", | ||
"formats": ["camelCase"] | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |