Skip to content

Commit 158fc57

Browse files
authored
Enable unnecessary_async lint rule (#9184)
1 parent d0bc34f commit 158fc57

16 files changed

Lines changed: 21 additions & 20 deletions

File tree

analysis_options.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ linter:
127127
# - type_annotate_public_apis # subset of always_specify_types
128128
- type_init_formals
129129
- unawaited_futures
130+
- unnecessary_async
130131
- unnecessary_brace_in_string_interps
131132
- unnecessary_const
132133
- unnecessary_getters_setters

packages/devtools_app/lib/src/screens/inspector_v2/inspector_screen_body.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class InspectorScreenBodyState extends State<InspectorScreenBody>
6565
}
6666

6767
@override
68-
void didChangeDependencies() async {
68+
void didChangeDependencies() {
6969
super.didChangeDependencies();
7070

7171
if (serviceConnection.inspectorService == null) {

packages/devtools_app/lib/src/screens/vm_developer/object_inspector/vm_simple_list_display.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class _VmSimpleListDisplayState extends State<VmSimpleListDisplay> {
4949
_initialize();
5050
}
5151

52-
void _initialize() async {
52+
void _initialize() {
5353
entries.clear();
5454
final elementsInstance = widget.vmObject.elementsAsInstance;
5555
if (elementsInstance != null) {

packages/devtools_app/lib/src/shared/config_specific/drag_and_drop/_drag_and_drop_web.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import 'dart:async';
66
import 'dart:convert';
77
import 'dart:js_interop';
8+
89
import 'package:web/web.dart';
910

1011
import '../../globals.dart';
@@ -51,7 +52,7 @@ class DragAndDropManagerWeb extends DragAndDropManager {
5152
dragLeave();
5253
}
5354

54-
void _onDrop(MouseEvent event) async {
55+
void _onDrop(MouseEvent event) {
5556
drop();
5657

5758
// Stop the browser from redirecting.

packages/devtools_app/lib/src/shared/framework/routing.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class DevToolsRouteInformationParser
4545
@override
4646
Future<DevToolsRouteConfiguration> parseRouteInformation(
4747
RouteInformation routeInformation,
48-
) async {
48+
) {
4949
var uri = routeInformation.uri;
5050
if (_testQueryParams != null) {
5151
uri = uri.replace(queryParameters: _testQueryParams.params);

packages/devtools_app/lib/src/standalone_ui/ide_shared/property_editor/property_editor_controller.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class PropertyEditorController extends DisposableController
8989

9090
// Update in response to ActiveLocationChanged events.
9191
autoDisposeStreamSubscription(
92-
editorClient.activeLocationChangedStream.listen((event) async {
92+
editorClient.activeLocationChangedStream.listen((event) {
9393
if (_waitingForFirstEvent) _waitingForFirstEvent = false;
9494
final textDocument = event.textDocument;
9595
final cursorPosition = event.selections.first.active;

packages/devtools_app/test/screens/deep_link_validation/deep_links_screen_test.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ final mockProjectRootUris =
3636
.toList();
3737

3838
void main() {
39-
// ignore: avoid-redundant-async, false positive.
40-
setUp(() async {
39+
setUp(() {
4140
setGlobal(ServiceConnectionManager, FakeServiceConnectionManager());
4241
setGlobal(
4342
DevToolsEnvironmentParameters,

packages/devtools_app/test/screens/deep_link_validation/select_project_view_test.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ import 'package:mockito/mockito.dart';
1919
import '../../test_infra/utils/deep_links_utils.dart';
2020

2121
void main() {
22-
// ignore: avoid-redundant-async, false positive.
23-
setUp(() async {
22+
setUp(() {
2423
setGlobal(ServiceConnectionManager, FakeServiceConnectionManager());
2524
setGlobal(
2625
DevToolsEnvironmentParameters,

packages/devtools_app/test/screens/memory/diff/widgets/paths_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import '../../../../test_infra/scenes/memory/default.dart';
1111
void main() {
1212
test('Many retaining paths do not jank UI.', () async {
1313
final heap = HeapData(
14-
await MemoryDefaultSceneHeaps.manyPaths(),
14+
MemoryDefaultSceneHeaps.manyPaths(),
1515
created: DateTime.now(),
1616
);
1717
await heap.calculate;

packages/devtools_app/test/screens/memory/framework/memory_service_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ void main() {
2727
const FlutterRunConfiguration(withDebugger: true),
2828
);
2929

30-
env.afterNewSetup = () async {
30+
env.afterNewSetup = () {
3131
memoryController = MemoryController();
3232
};
3333
}

0 commit comments

Comments
 (0)