Skip to content

Would like a lint to handle unused tearoffs (or similar) #57760

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

Closed
eseidelGoogle opened this issue Aug 1, 2018 · 3 comments
Closed

Would like a lint to handle unused tearoffs (or similar) #57760

eseidelGoogle opened this issue Aug 1, 2018 · 3 comments
Labels
customer-flutter devexp-linter Issues with the analyzer's support for the linter package legacy-area-analyzer Use area-devexp instead.

Comments

@eseidelGoogle
Copy link

https://twitter.com/pavel_ismailov/status/1004641813548892161

Is the report, which came in via twitter.

foo.someFunction;

Is the typo which they wish the analyzer would have warned them about.

@MichaelRFairhurst
Copy link
Contributor

This is handled by unnecessary_statements, which it looks like is not enabled in the project:

flutter/analysis_options.yaml:

# - unnecessary_statements # not yet tested

unnecesary_statements gives list.clear; intsead of list.clear() as an example:

**BAD:**                                                                                                                                              
list.clear;

This appears to have test coverage:

class MyClass {
  int foo() => null;
}

main() {
  new MyClass().foo; // LINT
}

I'm making a PR now to turn this on in flutter.

@MichaelRFairhurst
Copy link
Contributor

Not sure if I'm doing this right, but, PR here: flutter/flutter#20099

@pq
Copy link
Member

pq commented Aug 1, 2018

Awesome. As I mentioned there, if it lands in flutter, you'll want to add it to https://github.com/flutter/plugins/blob/master/analysis_options.yaml as well.

@devoncarew devoncarew added devexp-linter Issues with the analyzer's support for the linter package legacy-area-analyzer Use area-devexp instead. labels Nov 18, 2024
@devoncarew devoncarew transferred this issue from dart-archive/linter Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-flutter devexp-linter Issues with the analyzer's support for the linter package legacy-area-analyzer Use area-devexp instead.
Projects
None yet
Development

No branches or pull requests

4 participants