Describe the issue
no_adjacent_strings_in_list should trigger when the collection if is missing a trailing comma.
To Reproduce
List<String> list = <String>[
'a',
'b'
'c'
];
triggers the lint but
List<String> list = <String>[
'a',
if (true) 'b'
'c'
];
does not.
Expected behavior
Lint warning: DON'T use adjacent strings in list. on the if (true) 'b' line.
Additional context
Real world bug:
https://github.com/flutter/flutter/pull/70325/files#diff-fbf1a86439c67e75e90a00f32fd2b789323582ced2f4f5cfea2d27a1af18aa30R427
I think the additional logic we need here is "no adjacent strings in collections or in collection elements"
I agree. This lint was probably missed when we added collection elements.
We may implement this with a new rule: https://github.com/dart-lang/linter/issues/2727