avoid-multi-assignment
Warns when multiple variable assignments are placed on the same line.
Example
❌ Bad:
class SomeClass {
String someString = 'some';
String another = 'another';
void update(String str) {
someString = another = str; // LINT
final instance = SomeClass();
instance.another = someString = str; // LINT
}
}
✅ Good:
class SomeClass {
String someString = 'some';
String another = 'another';
void update(String str) {
someString = str;
another = str;
}
}