Skip to content

Commit 13e36f1

Browse files
committed
fixed linting - debugExtension
1 parent 286199c commit 13e36f1

File tree

9 files changed

+16
-16
lines changed

9 files changed

+16
-16
lines changed

dwds/analysis_options.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,3 @@ analyzer:
66
- "lib/data/*"
77
# Ignore debug extension builds
88
- "debug_extension/compiled/*"
9-
10-
linter:
11-
rules:
12-
- always_use_package_imports

dwds/debug_extension/web/chrome_api.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,10 @@ class NavigationInfo {
403403
@JS()
404404
@anonymous
405405
class Windows {
406-
external dynamic create(WindowInfo? createData, Function(WindowObj) callback);
406+
external dynamic create(
407+
WindowInfo? createData,
408+
void Function(WindowObj) callback,
409+
);
407410

408411
external OnFocusChangedHandler get onFocusChanged;
409412
}

dwds/debug_extension/web/cider_connection.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ void _sendMessageToCider(String json) {
100100
}
101101

102102
Future<void> _handleMessageFromCider(dynamic message, Port _) async {
103-
final key = getProperty(message as Object, 'key');
104-
final json = getProperty(message, 'json');
103+
final key = getProperty<String?>(message as Object, 'key');
104+
final json = getProperty<String?>(message, 'json');
105105
if (key != _ciderDartMessageKey || json is! String) {
106106
sendErrorMessageToCider(
107107
errorType: CiderErrorType.invalidRequest,

dwds/debug_extension/web/cross_extension_communication.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ void _forwardCommandToChromeDebugger(
7676
options.method,
7777
options.commandParams,
7878
allowInterop(
79-
([result]) => _respondWithChromeResult(result, sendResponse),
79+
([Object? result]) => _respondWithChromeResult(result, sendResponse),
8080
),
8181
);
8282
} catch (e) {
@@ -110,7 +110,7 @@ void _forwardMessageToAngularDartDevTools(ExternalExtensionMessage message) {
110110
message,
111111
// options
112112
null,
113-
allowInterop(([result]) => _checkForErrors(result, message.name)),
113+
allowInterop(([Object? result]) => _checkForErrors(result, message.name)),
114114
);
115115
}
116116

dwds/debug_extension/web/debug_session.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ void _forwardDwdsEventToChromeDebugger(
449449
Debuggee(tabId: tabId),
450450
message.command,
451451
js_util.jsify(params),
452-
allowInterop(([e]) {
452+
allowInterop(([Object? e]) {
453453
// No arguments indicate that an error occurred.
454454
if (e == null) {
455455
client.sink.add(

dwds/debug_extension/web/detector.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,11 @@ void _detectMultipleDartAppsCallback(
9999
bool _isMultipleAppsMutation(dynamic mutation) {
100100
final isAttributeMutation =
101101
hasProperty(mutation as Object, 'type') &&
102-
getProperty(mutation, 'type') == 'attributes';
102+
getProperty<String?>(mutation, 'type') == 'attributes';
103103
if (isAttributeMutation) {
104104
return hasProperty(mutation, 'attributeName') &&
105-
getProperty(mutation, 'attributeName') == _multipleAppsAttribute;
105+
getProperty<String?>(mutation, 'attributeName') ==
106+
_multipleAppsAttribute;
106107
}
107108
return false;
108109
}

dwds/debug_extension/web/storage.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ void interceptStorageChange<T>({
151151
final isExpected = hasProperty(storageObj, expectedStorageKey);
152152
if (!isExpected) return;
153153

154-
final objProp = getProperty(storageObj, expectedStorageKey);
154+
final objProp = getProperty<Object?>(storageObj, expectedStorageKey);
155155
final json = getProperty(objProp as Object, 'newValue') as String?;
156156
T? decodedObj;
157157
if (json == null || T == String) {

dwds/debug_extension/web/utils.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ final bool isDevMode = () {
124124
final bool isMV3 = () {
125125
final extensionManifest = chrome.runtime.getManifest();
126126
final manifestVersion =
127-
getProperty(extensionManifest, 'manifest_version') ?? 2;
127+
getProperty<int?>(extensionManifest, 'manifest_version') ?? 2;
128128
return manifestVersion == 3;
129129
}();
130130

dwds/debug_extension/web/web_api.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ external Object _nativeJsFetch(String resourceUrl, FetchOptions options);
3232
Future<FetchResponse> fetchRequest(String resourceUrl) async {
3333
try {
3434
final options = FetchOptions(method: 'GET', credentials: 'include');
35-
final response = await promiseToFuture(
35+
final response = await promiseToFuture<Object>(
3636
_nativeJsFetch(resourceUrl, options),
3737
);
3838
final body = await promiseToFuture<String?>(
39-
js_util.callMethod(response as Object, 'text', []),
39+
js_util.callMethod(response, 'text', []),
4040
);
4141
final ok = js_util.getProperty<bool>(response, 'ok');
4242
final status = js_util.getProperty<int>(response, 'status');

0 commit comments

Comments
 (0)