Skip to content

Commit ef49d38

Browse files
committed
fixed linting errors
1 parent 228d095 commit ef49d38

File tree

16 files changed

+93
-72
lines changed

16 files changed

+93
-72
lines changed

dwds/debug_extension/web/background.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ Future<void> _handleRuntimeMessages(
181181
},
182182
);
183183

184-
sendResponse(defaultResponse);
184+
(sendResponse as void Function(Object?))(defaultResponse);
185185
}
186186

187187
Future<void> _detectNavigationAwayFromDartApp(

dwds/debug_extension/web/copier.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ void _handleRuntimeMessages(
3838
messageHandler: _copyAppId,
3939
);
4040

41-
sendResponse(defaultResponse);
41+
(sendResponse as void Function(Object?))(defaultResponse);
4242
}
4343

4444
void _copyAppId(String appId) {

dwds/debug_extension/web/cross_extension_communication.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ Future<void> handleMessagesFromAngularDartDevTools(
4343
await _respondWithEncodedUri(message.tabId, sendResponse);
4444
} else if (message.name == 'dwds.startDebugging') {
4545
await attachDebugger(message.tabId, trigger: Trigger.angularDartDevTools);
46-
sendResponse(true);
46+
(sendResponse as void Function(Object?))(true);
4747
} else {
48-
sendResponse(
48+
(sendResponse as void Function(Object?))(
4949
ErrorResponse()..error = 'Unknown message name: ${message.name}',
5050
);
5151
}
@@ -80,19 +80,19 @@ void _forwardCommandToChromeDebugger(
8080
),
8181
);
8282
} catch (e) {
83-
sendResponse(ErrorResponse()..error = '$e');
83+
(sendResponse as void Function(Object?))(ErrorResponse()..error = '$e');
8484
}
8585
}
8686

8787
void _respondWithChromeResult(Object? chromeResult, Function sendResponse) {
8888
// No result indicates that an error occurred.
8989
if (chromeResult == null) {
90-
sendResponse(
90+
(sendResponse as void Function(Object?))(
9191
ErrorResponse()
9292
..error = JSON.stringify(chrome.runtime.lastError ?? 'Unknown error.'),
9393
);
9494
} else {
95-
sendResponse(chromeResult);
95+
(sendResponse as void Function(Object?))(chromeResult);
9696
}
9797
}
9898

@@ -101,7 +101,7 @@ Future<void> _respondWithEncodedUri(int tabId, Function sendResponse) async {
101101
type: StorageObject.encodedUri,
102102
tabId: tabId,
103103
);
104-
sendResponse(encodedUri ?? '');
104+
(sendResponse as void Function(Object?))(encodedUri ?? '');
105105
}
106106

107107
void _forwardMessageToAngularDartDevTools(ExternalExtensionMessage message) {

dwds/debug_extension/web/debug_session.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,8 @@ Future<void> _onDebuggerEvent(
278278
}
279279

280280
Future<void> _maybeConnectToDwds(int tabId, Object? params) async {
281-
final context = json.decode(JSON.stringify(params))['context'];
281+
final decoded = json.decode(JSON.stringify(params)) as Map<String, dynamic>;
282+
final context = decoded['context'] as Map<String, dynamic>;
282283
final contextOrigin = context['origin'] as String?;
283284
if (contextOrigin == null) return;
284285
if (contextOrigin.contains('chrome-extension:')) return;

dwds/debug_extension/web/messaging.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import 'utils.dart';
2424
//
2525
// Prevents the message port from closing. See:
2626
// https://developer.chrome.com/docs/extensions/mv3/messaging/#simple
27-
final defaultResponse = jsify({'response': 'received'});
27+
final defaultResponse = jsify({'response': 'received'}) as Object;
2828

2929
enum Script {
3030
background,

dwds/lib/config.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
export 'src/config/tool_configuration.dart'
66
show
77
AppMetadata,
8-
ToolConfiguration,
9-
UrlEncoder,
8+
DebugSettings,
109
DevToolsLauncher,
11-
DebugSettings;
10+
ToolConfiguration,
11+
UrlEncoder;

dwds/lib/src/debugging/chrome_inspector.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,8 @@ class ChromeAppInspector extends AppInspector {
165165
if (namedArgs.isNotEmpty) {
166166
throw UnsupportedError('Named arguments are not yet supported');
167167
}
168-
// We use the JS pseudo-variable 'arguments' to get the list of all arguments.
168+
// We use the JS pseudo-variable 'arguments' to get the list of all
169+
// arguments.
169170
final send = globalToolConfiguration.loadStrategy.dartRuntimeDebugger
170171
.callInstanceMethodJsExpression(methodName);
171172
final remote = await jsCallFunctionOn(receiver, send, positionalArgs);

dwds/lib/src/debugging/classes.dart

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -95,31 +95,33 @@ class ChromeAppClassHelper {
9595
final classDescriptor = _mapify(result.value);
9696
final methodRefs = <FuncRef>[];
9797
final methodDescriptors = _mapify(classDescriptor['methods']);
98-
methodDescriptors.forEach((name, descriptor) {
98+
methodDescriptors.forEach((name, dynamic descriptor) {
99+
final typedDescriptor = descriptor as Map<String, dynamic>;
99100
final methodId = 'methods|$classId|$name';
100101
methodRefs.add(
101102
FuncRef(
102103
id: methodId,
103104
name: name,
104105
owner: classRef,
105-
isConst: descriptor['isConst'] as bool? ?? false,
106-
isStatic: descriptor['isStatic'] as bool? ?? false,
107-
implicit: descriptor['isImplicit'] as bool? ?? false,
108-
isAbstract: descriptor['isAbstract'] as bool? ?? false,
109-
isGetter: descriptor['isGetter'] as bool? ?? false,
110-
isSetter: descriptor['isSetter'] as bool? ?? false,
106+
isConst: typedDescriptor['isConst'] as bool? ?? false,
107+
isStatic: typedDescriptor['isStatic'] as bool? ?? false,
108+
implicit: typedDescriptor['isImplicit'] as bool? ?? false,
109+
isAbstract: typedDescriptor['isAbstract'] as bool? ?? false,
110+
isGetter: typedDescriptor['isGetter'] as bool? ?? false,
111+
isSetter: typedDescriptor['isSetter'] as bool? ?? false,
111112
),
112113
);
113114
});
114115
final fieldRefs = <FieldRef>[];
115116

116117
final fieldDescriptors = _mapify(classDescriptor['fields']);
117-
fieldDescriptors.forEach((name, descriptor) {
118+
fieldDescriptors.forEach((name, dynamic descriptor) {
119+
final typedDescriptor = descriptor as Map<String, dynamic>;
118120
final classMetaData = ClassMetaData(
119121
runtimeKind: RuntimeObjectKind.type,
120122
classRef: classRefFor(
121-
descriptor['classLibraryId'],
122-
descriptor['className'],
123+
typedDescriptor['classLibraryId'],
124+
typedDescriptor['className'],
123125
),
124126
);
125127

@@ -133,9 +135,9 @@ class ChromeAppClassHelper {
133135
kind: classMetaData.kind,
134136
classRef: classMetaData.classRef,
135137
),
136-
isConst: descriptor['isConst'] as bool? ?? false,
137-
isFinal: descriptor['isFinal'] as bool? ?? false,
138-
isStatic: descriptor['isStatic'] as bool? ?? false,
138+
isConst: typedDescriptor['isConst'] as bool? ?? false,
139+
isFinal: typedDescriptor['isFinal'] as bool? ?? false,
140+
isStatic: typedDescriptor['isStatic'] as bool? ?? false,
139141
id: createId(),
140142
),
141143
);

dwds/lib/src/debugging/debugger.dart

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -425,8 +425,10 @@ class Debugger {
425425
// Renders the paused at breakpoint overlay over the application.
426426
// void _showPausedOverlay() async {
427427
// if (_pausedOverlayVisible) return;
428-
// handleErrorIfPresent(await _remoteDebugger?.sendCommand('DOM.enable'));
429-
// handleErrorIfPresent(await _remoteDebugger?.sendCommand('Overlay.enable'));
428+
// handleErrorIfPresent(
429+
// await _remoteDebugger?.sendCommand('DOM.enable'));
430+
// handleErrorIfPresent(
431+
// await _remoteDebugger?.sendCommand('Overlay.enable'));
430432
// handleErrorIfPresent(await _remoteDebugger
431433
// ?.sendCommand('Overlay.setPausedInDebuggerMessage', params: {
432434
// 'message': 'Paused',
@@ -437,7 +439,8 @@ class Debugger {
437439
// Removes the paused at breakpoint overlay from the application.
438440
// void _hidePausedOverlay() async {
439441
// if (!_pausedOverlayVisible) return;
440-
// handleErrorIfPresent(await _remoteDebugger?.sendCommand('Overlay.disable'));
442+
// handleErrorIfPresent(
443+
// await _remoteDebugger?.sendCommand('Overlay.disable'));
441444
// _pausedOverlayVisible = false;
442445
// }
443446

dwds/lib/src/debugging/libraries.dart

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,18 @@
33
// BSD-style license that can be found in the LICENSE file.
44

55
import 'package:collection/collection.dart';
6-
import 'package:dwds/src/config/tool_configuration.dart';
7-
import 'package:dwds/src/debugging/chrome_inspector.dart';
8-
import 'package:dwds/src/debugging/inspector.dart';
9-
import 'package:dwds/src/debugging/metadata/class.dart';
10-
import 'package:dwds/src/debugging/metadata/provider.dart';
11-
import 'package:dwds/src/services/chrome/chrome_debug_exception.dart';
126
import 'package:logging/logging.dart';
137
import 'package:meta/meta.dart';
148
import 'package:vm_service/vm_service.dart';
159
import 'package:webkit_inspection_protocol/webkit_inspection_protocol.dart';
1610

11+
import '../config/tool_configuration.dart';
12+
import '../services/chrome/chrome_debug_exception.dart';
13+
import 'chrome_inspector.dart';
14+
import 'inspector.dart';
15+
import 'metadata/class.dart';
16+
import 'metadata/provider.dart';
17+
1718
/// Keeps track of Dart libraries available in the running application.
1819
class LibraryHelper<T extends AppInspector> {
1920
final Logger _logger = Logger('LibraryHelper');

0 commit comments

Comments
 (0)