dart-lang / lints

Official Dart lint rules; the core and recommended set of lints suggested by the Dart team.
https://pub.dev/packages/lints
BSD 3-Clause "New" or "Revised" License
118 stars 30 forks source link

Consider `unawaited_futures` for inclusion #25

Open mit-mit opened 3 years ago

mit-mit commented 3 years ago

We had initially selected unawaited_futures for inclusion in core lints, however ran into some issues that need resolving first, including:

jacob314 commented 3 years ago

+1 on adding a method side opt out for unawaited_futures. We see a very large # of calls to unawaited in g3 (about 10% of all calls to awaited). Likely a small # of method side opt outs can reduce this # significantly.

pq commented 3 years ago

@goderbauer: do any Flutter APIs spring to mind that you'd want to tag as unwaitable? it'd be handy to have some concrete examples to drive the discussion.

goderbauer commented 3 years ago

The Future-returning APIs on AnimationController and Navigator are the most common examples, things like AnimationController.forward() / AnimationController.reverse() and Navigator.push() as well as its similarly named friends.

pq commented 3 years ago

Corresponding issue to discussion an annotation in pkg:meta here: https://github.com/dart-lang/sdk/issues/46218.

natebosch commented 3 years ago

https://api.dart.dev/stable/2.14.4/dart-async/unawaited.html

mit-mit commented 2 years ago

@pq to create a proposal for how this would work