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)