Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider adding unnecessary_statements to the recommended set #844

Open
DanTup opened this issue Dec 20, 2024 · 0 comments
Open

Consider adding unnecessary_statements to the recommended set #844

DanTup opened this issue Dec 20, 2024 · 0 comments

Comments

@DanTup
Copy link
Contributor

DanTup commented Dec 20, 2024

I was asked today by a new Dart developer why his code didn't produce any diagnostics when he'd missed the () from the end of a method call:

state.foo;

This isn't the first time this has come up to me, and it's also been asked for in the SDK. It seems like a useful lint and it seems like the false positives are real edge cases (like side effects in operators) so I wonder if it would be useful to recommend?

Some issues requesting this (or issues that it may have been avoided if it was used):

Additionally, it is enabled in the Flutter repository:

Possible false positives I can find are all related to operators with side effects (which I think is probably acceptable - I don't think this is common, except perhaps while print-debugging!):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant