Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 37 additions & 15 deletions dwds/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,41 +26,63 @@ linter:
# TODO(https://github.com/dart-lang/webdev/issues/2053): Enable commented-out rules with fixes.
dart_code_metrics:
metrics:
# cyclomatic-complexity: 20
# number-of-parameters: 5
# maximum-nesting-level: 5
# cyclomatic-complexity: 20 # Enable.
# number-of-parameters: 5 # Enable.
# maximum-nesting-level: 5 # Enable.
metrics-exclude:
- test/**
rules:
# - arguments-ordering
# - avoid-banned-imports
- avoid-cascade-after-if-null
- avoid-collection-methods-with-unrelated-types
# - avoid-double-slash-imports
- avoid-duplicate-exports
# - avoid-global-state
# - avoid-dynamic
# - avoid-global-state # Enable.
# - avoid-ignoring-return-values
# - avoid-late-keyword
- avoid-missing-enum-constant-in-map
- avoid-nested-conditional-expressions
- avoid-non-ascii-symbols
# - avoid-non-null-assertion
# - avoid-passing-async-when-sync-expected
# - avoid-non-null-assertion # Enable.
# - avoid-passing-async-when-sync-expected # Enable.
- avoid-redundant-async
# - avoid-throw-in-catch-block
# - avoid-throw-in-catch-block # Enable.
# - avoid-top-level-members-in-tests
# - avoid-unnecessary-conditionals
- avoid-unnecessary-type-assertions
- avoid-unnecessary-type-casts
- avoid-unrelated-type-assertions
- avoid-unused-parameters
# - ban-name
- binary-expression-operand-order
- double-literal-format
# - format-comment
# - member-ordering
# - format-comment # Enable.
# - list-all-equatable-fields
# - member-ordering # Enable.
# - missing-test-assertion
# - new-line-before-return
- no-boolean-literal-compare
# - no-empty-block
# - no-empty-block # Enable.
# - no-equal-arguments
- no-equal-then-else
# - prefer-async-await
# - prefer-commenting-analyzer-ignores
# - prefer-correct-test-file-name
# - no-magic-number
# - no-object-declaration
# - prefer-async-await # Enable.
# - prefer-commenting-analyzer-ignores # Enable.
# - prefer-conditional-expressions
# - prefer-correct-identifier-length
# - prefer-correct-test-file-name # Enable.
- prefer-correct-type-name
- prefer-enums-by-name
# - prefer-immediate-return
# - prefer-first
# - prefer-immediate-return # Enable.
- prefer-iterable-of
- prefer-last
# - prefer-moving-to-variable:
# - prefer-match-file-name
# - prefer-moving-to-variable: # Enable.
# allow-duplicated-chains: 2
# - prefer-static-class
# - prefer-trailing-comma
# - tag-name
3 changes: 2 additions & 1 deletion dwds/debug_extension_mv3/web/background.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ void _registerListeners() {
Future<void> _handleRuntimeMessages(
dynamic jsRequest,
MessageSender sender,
Function _,
// ignore: avoid-unused-parameters
Function sendResponse,
) async {
if (jsRequest is! String) return;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ final _eventsForAngularDartDevTools = {

Future<void> handleMessagesFromAngularDartDevTools(
dynamic jsRequest,
MessageSender _,
// ignore: avoid-unused-parameters
MessageSender sender,
Function sendResponse,
) async {
if (jsRequest == null) return;
Expand Down Expand Up @@ -107,7 +108,7 @@ void _forwardMessageToAngularDartDevTools(ExternalExtensionMessage message) {
chrome.runtime.sendMessage(
_angularDartDevToolsId,
message,
/* options */
// options
null,
allowInterop(([result]) => _checkForErrors(result, message.name)),
);
Expand Down
6 changes: 3 additions & 3 deletions dwds/debug_extension_mv3/web/debug_session.dart
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,10 @@ _enableExecutionContextReporting(int tabId) {
if (chromeError != null) {
final errorMessage = _translateChromeError(chromeError.message);
chrome.notifications.create(
/*notificationId*/
// notificationId
null,
NotificationOptions(message: errorMessage),
/*callback*/
// callback
null,
);
return;
Expand Down Expand Up @@ -684,7 +684,7 @@ Future<bool> _sendAuthRequest(String authUrl) async {
Future<bool> _showWarningNotification(String message) {
final completer = Completer<bool>();
chrome.notifications.create(
/*notificationId*/
// notificationId
null,
NotificationOptions(
title: '[Error] Dart Debug Extension',
Expand Down
2 changes: 1 addition & 1 deletion dwds/debug_extension_mv3/web/lifeline_connection.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ void _connectToLifelinePort() {
prefix: 'Dart Debug Extension',
);
chrome.runtime.connect(
/*extensionId=*/
// extensionId
null,
ConnectInfo(name: 'keepAlive'),
);
Expand Down
4 changes: 2 additions & 2 deletions dwds/debug_extension_mv3/web/messaging.dart
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ Future<bool> sendRuntimeMessage({
);
final completer = Completer<bool>();
chrome.runtime.sendMessage(
/*id*/
// id
null,
message.toJSON(),
/*options*/
// options
null,
allowInterop(() {
final error = chrome.runtime.lastError;
Expand Down
6 changes: 4 additions & 2 deletions dwds/debug_extension_mv3/web/panel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,10 @@ Future<void> _registerListeners() async {

void _handleRuntimeMessages(
dynamic jsRequest,
MessageSender _,
Function __,
// ignore: avoid-unused-parameters
MessageSender sender,
// ignore: avoid-unused-parameters
Function sendResponse,
) {
if (jsRequest is! String) return;

Expand Down
4 changes: 2 additions & 2 deletions dwds/debug_extension_mv3/web/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@ void setExtensionIcon(IconInfo info) {
if (isMV3) {
_setExtensionIconMV3(
info,
/*callback*/
// callback
null,
);
} else {
_setExtensionIconMV2(
info,
/*callback*/
// callback
null,
);
}
Expand Down