Skip to main content

avoid-unnecessary-call

added in: 1.7.0

Warns when a .call() invocation is unnecessary and can be simplified.

Example

❌ Bad:

class SomeClass {
void call() {
...
}
}

final instance = SomeClass();
instance.call(); // LINT

✅ Good:

class SomeClass {
void call() {
...
}
}

final instance = SomeClass();
instance();