File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
tests/specs/complexity/noUselessStringConcat Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change @@ -14,12 +14,12 @@ const a = foo + 'a' + 'b'
1414const a = foo + ` a ` + ` b `
1515const a = (number + 1) + 'px'
1616const a = (1 + +2) + ` b `
17- const stylisticConcat = 'foo' +
17+ const stylisticConcat = 'foo' + // formatting
1818 'bar'
1919const stylisticConcat = ` foo ` +
2020 'bar' +
2121 ` baz `
22- const stylisticConcatLeading = 'foo'
22+ const stylisticConcatLeading = 'foo' // formatting
2323 + 'bar'
2424const stylisticConcatLeading = ` foo `
2525 + 'bar'
You can’t perform that action at this time.
0 commit comments