It is a common typo to forget to call a function, but instead just leave the closure there, especially when doing refactoring etc. Thus, this rule will avoid this.
What type of rule is this?
Warns about a potential problem
Example code
Example 1:
InkWell(
onTap: () => _handle, // BAD
onTap: () => _handle(), // GOOD
onTap: _handle, // GOOD
)
void _handle() { ... }
Example 2:
extension Ext on List {
void myFunction(int a) { ... }
}
Something(
someCallback: (a) => myList.myFunction, // BAD
someCallback: (a) => myList.myFunction(a), // GOOD
someCallback: myList.myFunction, // GOOD
)
### Participation
- [X] I am willing to submit a pull request to implement this rule.
### Additional comments
_No response_
Rule details
It is a common typo to forget to call a function, but instead just leave the closure there, especially when doing refactoring etc. Thus, this rule will avoid this.
What type of rule is this?
Warns about a potential problem
Example code
Example 2: