-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
P3A lower priority bug or feature requestA lower priority bug or feature requestarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-linterIssues with the analyzer's support for the linter packageIssues with the analyzer's support for the linter packagetype-enhancementA request for a change that isn't a bugA request for a change that isn't a bug
Description
We already have this lint that warns you about unawaited futures if you marked your method async. I propose a broader version of this that looks that warns about unuawaited futures without caring about the async tag. It would only apply to tests because it is very rare for a developer to write test code calling async functions where they do not want to wait for the result:
test('tests something', () {
var myObj = new MyObj();
myObj.doSomething(); // It happens to be async
expect(myObj.someState, 'good');
});
This code looks perfectly fine and raises no linter alarms. What they meant to write is:
test('tests something', () async {
var myObj = new MyObj();
await myObj.doSomething();
expect(myObj.someState, 'good');
});
Metadata
Metadata
Assignees
Labels
P3A lower priority bug or feature requestA lower priority bug or feature requestarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-linterIssues with the analyzer's support for the linter packageIssues with the analyzer's support for the linter packagetype-enhancementA request for a change that isn't a bugA request for a change that isn't a bug