Why this matters
The spread operator (`...` and `...?`) flattens collections directly, making `toList()` redundant and inefficient.
Remove unnecessary `.toList()` calls when using the spread operator (`...`) to avoid redundant operations.
The spread operator (`...` and `...?`) flattens collections directly, making `toList()` redundant and inefficient.
Side-by-side examples engineers can pattern-match during review.
final list = [
1,
2,
...anIterable.toList(), // Noncompliant
3,
4
];final list = [
1,
2,
...anIterable,
3,
4
];final list = [
1,
2,
...anIterable.toList(), // Noncompliant
3,
4
];final list = [
1,
2,
...anIterable,
3,
4
];From the same buckets as this rule.