Skip to content

Commit 46a7f17

Browse files
authored
fix: biome 1.8.3 (#13)
1 parent 73a0bd6 commit 46a7f17

2 files changed

Lines changed: 21 additions & 14 deletions

File tree

Cargo.toml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ wasm = ["serde_json", "dprint-core/wasm"]
2525

2626
[dependencies]
2727
anyhow = "1.0.51"
28-
biome_css_formatter = { git = "https://github.com/biomejs/biome", tag = "cli/v1.8.0" }
29-
biome_css_parser = { git = "https://github.com/biomejs/biome", tag = "cli/v1.8.0" }
30-
biome_css_syntax = { git = "https://github.com/biomejs/biome", tag = "cli/v1.8.0" }
31-
biome_diagnostics = { git = "https://github.com/biomejs/biome", tag = "cli/v1.8.0" }
32-
biome_formatter = { git = "https://github.com/biomejs/biome", tag = "cli/v1.8.0" }
33-
biome_js_formatter = { git = "https://github.com/biomejs/biome", tag = "cli/v1.8.0" }
34-
biome_js_parser = { git = "https://github.com/biomejs/biome", tag = "cli/v1.8.0" }
35-
biome_js_syntax = { git = "https://github.com/biomejs/biome", tag = "cli/v1.8.0" }
36-
biome_json_formatter = { git = "https://github.com/biomejs/biome", tag = "cli/v1.8.0" }
37-
biome_json_parser = { git = "https://github.com/biomejs/biome", tag = "cli/v1.8.0" }
28+
biome_css_formatter = { git = "https://github.com/biomejs/biome", tag = "cli/v1.8.3" }
29+
biome_css_parser = { git = "https://github.com/biomejs/biome", tag = "cli/v1.8.3" }
30+
biome_css_syntax = { git = "https://github.com/biomejs/biome", tag = "cli/v1.8.3" }
31+
biome_diagnostics = { git = "https://github.com/biomejs/biome", tag = "cli/v1.8.3" }
32+
biome_formatter = { git = "https://github.com/biomejs/biome", tag = "cli/v1.8.3" }
33+
biome_js_formatter = { git = "https://github.com/biomejs/biome", tag = "cli/v1.8.3" }
34+
biome_js_parser = { git = "https://github.com/biomejs/biome", tag = "cli/v1.8.3" }
35+
biome_js_syntax = { git = "https://github.com/biomejs/biome", tag = "cli/v1.8.3" }
36+
biome_json_formatter = { git = "https://github.com/biomejs/biome", tag = "cli/v1.8.3" }
37+
biome_json_parser = { git = "https://github.com/biomejs/biome", tag = "cli/v1.8.3" }
3838
dprint-core = { version = "0.67.0", default-features = false }
3939
serde = { version = "1.0.193", features = ["derive"] }
4040
serde_json = { version = "1.0", optional = true }

src/format_text.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ use biome_json_formatter::context::JsonFormatOptions;
1818
use biome_json_parser::parse_json;
1919
use biome_json_parser::JsonParserOptions;
2020
use biome_json_parser::ParseDiagnostic;
21+
use serde::de::value;
2122
use std::path::Path;
2223
use std::str::FromStr;
2324

@@ -127,7 +128,9 @@ fn build_json_options(config: &Configuration) -> Result<JsonFormatOptions> {
127128
});
128129
}
129130
if let Some(value) = config.json_indent_width {
130-
options = options.with_indent_width(value.into());
131+
if let Ok(value) = value.try_into() {
132+
options = options.with_indent_width(value);
133+
}
131134
}
132135
if let Some(line_ending) = config.line_ending {
133136
options = options.with_line_ending(match line_ending {
@@ -153,7 +156,9 @@ fn build_css_options(config: &Configuration, syntax: CssFileSource) -> Result<Cs
153156
});
154157
}
155158
if let Some(value) = config.css_indent_width {
156-
options = options.with_indent_width(value.into());
159+
if let Ok(value) = value.try_into() {
160+
options = options.with_indent_width(value);
161+
}
157162
}
158163
if let Some(line_width) = config.css_line_width {
159164
options = options.with_line_width(
@@ -184,8 +189,10 @@ fn build_js_options(config: &Configuration, syntax: JsFileSource) -> Result<JsFo
184189
crate::configuration::IndentStyle::Space => IndentStyle::Space,
185190
});
186191
}
187-
if let Some(indent_width) = config.javascript_indent_width {
188-
options = options.with_indent_width(indent_width.into());
192+
if let Some(value) = config.javascript_indent_width {
193+
if let Ok(value) = value.try_into() {
194+
options = options.with_indent_width(value);
195+
}
189196
}
190197
if let Some(line_width) = config.javascript_line_width {
191198
options = options.with_line_width(

0 commit comments

Comments
 (0)