Skip to content

Commit 1052412

Browse files
committed
perf: jsonc-parser 0.32
1 parent 926316f commit 1052412

5 files changed

Lines changed: 17 additions & 9 deletions

File tree

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ wasm = ["dprint-core/wasm"]
2626
[dependencies]
2727
anyhow = "1.0.51"
2828
dprint-core = { version = "0.67.4", features = ["formatting"] }
29-
jsonc-parser = "0.27.0"
29+
jsonc-parser = "0.32.0"
3030
serde = { version = "1.0.108", features = ["derive"] }
3131
serde_json = "1.0"
3232

dprint.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
"**/target"
1313
],
1414
"plugins": [
15-
"https://plugins.dprint.dev/typescript-0.88.4.wasm",
16-
"https://plugins.dprint.dev/json-0.19.0.wasm",
17-
"https://plugins.dprint.dev/markdown-0.16.2.wasm",
18-
"https://plugins.dprint.dev/toml-0.5.4.wasm",
19-
"https://plugins.dprint.dev/exec-0.4.4.json@c207bf9b9a4ee1f0ecb75c594f774924baf62e8e53a2ce9d873816a408cecbf7"
15+
"https://plugins.dprint.dev/typescript-0.95.15.wasm",
16+
"https://plugins.dprint.dev/json-0.21.3.wasm",
17+
"https://plugins.dprint.dev/markdown-0.21.1.wasm",
18+
"https://plugins.dprint.dev/toml-0.7.0.wasm",
19+
"https://plugins.dprint.dev/exec-0.6.0.json@a054130d458f124f9b5c91484833828950723a5af3f8ff2bd1523bd47b83b364"
2020
]
2121
}

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "1.90.0"
2+
channel = "1.94.0"
33
components = ["clippy", "rustfmt"]

src/format_text.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ fn format_inner(
3737
allow_comments: true,
3838
allow_loose_object_property_names: true,
3939
allow_trailing_commas: true,
40+
allow_missing_commas: true,
41+
allow_single_quoted_strings: true,
42+
allow_hexadecimal_numbers: true,
43+
allow_unary_plus_numbers: true,
4044
},
4145
)?;
4246
let Some(root_value) = parse_result.value else {
@@ -89,6 +93,10 @@ fn validate_output_json(text: &str) -> Result<()> {
8993
allow_comments: true,
9094
allow_loose_object_property_names: false,
9195
allow_trailing_commas: true,
96+
allow_missing_commas: false,
97+
allow_single_quoted_strings: false,
98+
allow_hexadecimal_numbers: false,
99+
allow_unary_plus_numbers: false,
92100
},
93101
);
94102
match result {

0 commit comments

Comments
 (0)