avoid-empty-spread
preset: recommended
Warns when a collection literal in spread (...[]) has no elements.
Example
❌ Bad:
void fn(bool flag) {
final another = [
...<String>[], // LINT: This spread has no elements. Try adding elements or removing it.
if (flag) ...<String>[], // LINT: This spread has no elements. Try adding elements or removing it.
];
}
✅ Good:
void fn(bool flag) {
final another = [
...<String>['some', 'elements'], // Correct, no empty spread
];
}