Skip to content

Commit 5b95065

Browse files
committed
updated docs and tests
1 parent dfcec77 commit 5b95065

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

crates/biome_js_analyze/src/lint/complexity/no_useless_string_concat.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ impl Rule for NoUselessStringConcat {
9898
let parent_binary_expression = get_parent_binary_expression(node);
9999

100100
// Prevent duplicated error reportings when the parent is a useless concatenation too, i.e.: "a" + "b" + "c"
101-
if parent_binary_expression.is_some()
102-
&& get_concatenation_range(&parent_binary_expression).is_some()
103-
{
101+
if parent_binary_expression.is_some_and(|parent_expression| {
102+
get_concatenation_range(&parent_expression).is_some()
103+
}) {
104104
return None;
105105
}
106106

crates/biome_js_analyze/tests/specs/complexity/noUselessStringConcat/valid.js.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ const a = foo + 'a' + 'b'
1414
const a = foo + `a` + `b`
1515
const a = (number + 1) + 'px'
1616
const a = (1 + +2) + `b`
17-
const stylisticConcat = 'foo' +
17+
const stylisticConcat = 'foo' + // formatting
1818
'bar'
1919
const stylisticConcat = `foo` +
2020
'bar' +
2121
`baz`
22-
const stylisticConcatLeading = 'foo'
22+
const stylisticConcatLeading = 'foo' // formatting
2323
+ 'bar'
2424
const stylisticConcatLeading = `foo`
2525
+ 'bar'

0 commit comments

Comments
 (0)