From 98068cb81fa689ad358632862ad43e79874edb0c Mon Sep 17 00:00:00 2001 From: "Arend van Beelen jr." Date: Wed, 1 Nov 2023 09:30:06 +0100 Subject: [PATCH] Fix parsing maxAllowedComplexity --- .../analyzers/complexity/no_excessive_cognitive_complexity.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/biome_js_analyze/src/analyzers/complexity/no_excessive_cognitive_complexity.rs b/crates/biome_js_analyze/src/analyzers/complexity/no_excessive_cognitive_complexity.rs index 8acb72a52663..dc7fa8500b35 100644 --- a/crates/biome_js_analyze/src/analyzers/complexity/no_excessive_cognitive_complexity.rs +++ b/crates/biome_js_analyze/src/analyzers/complexity/no_excessive_cognitive_complexity.rs @@ -415,7 +415,7 @@ impl VisitNode for ComplexityOptions { if name_text == "maxAllowedComplexity" { if let Some(value) = value .as_json_number_value() - .and_then(|number_value| u8::from_str(&number_value.syntax().to_string()).ok()) + .and_then(|number_value| u8::from_str(&number_value.text()).ok()) // Don't allow 0 or no code would pass. // And don't allow MAX_SCORE or we can't detect exceeding it. .filter(|&number| number > 0 && number < MAX_SCORE)