From d333805de67ab8ccf2f1ba67fcb4927953932cfa Mon Sep 17 00:00:00 2001 From: sebthom Date: Tue, 27 Feb 2024 13:50:52 +0100 Subject: [PATCH] update lint rules and fix lint warning --- analysis_options.yaml | 32 ++++++++++++++++---------------- lib/hotreloader.dart | 2 -- lib/src/util/docker.dart | 2 -- lib/src/util/files.dart | 2 -- lib/src/util/pub.dart | 2 -- lib/src/util/strings.dart | 1 - lib/src/util/vm.dart | 2 -- pubspec.yaml | 2 +- test/hotreloader_test.dart | 2 -- 9 files changed, 17 insertions(+), 30 deletions(-) diff --git a/analysis_options.yaml b/analysis_options.yaml index 0155971..2528c8b 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -10,63 +10,63 @@ analyzer: # see: # https://github.com/dart-lang/linter/tree/master/lib/src/rules -# https://dart-lang.github.io/linter/lints/ +# https://dart.dev/tools/linter-rules/ linter: rules: - # https://dart-lang.github.io/linter/lints/avoid_dynamic_calls.html + # https://dart.dev/tools/linter-rules/avoid_dynamic_calls avoid_dynamic_calls: false # https://github.com/passsy/dart-lint/blob/master/lib/analysis_options.yaml avoid_equals_and_hash_code_on_mutable_classes: true - # https://dart-lang.github.io/linter/lints/avoid_returning_this.html + # https://dart.dev/tools/linter-rules/avoid_returning_this avoid_returning_this: true - # https://dart-lang.github.io/linter/lints/avoid_final_parameters.html + # https://dart.dev/tools/linter-rules/avoid_final_parameters avoid_final_parameters: false - # https://dart-lang.github.io/linter/lints/avoid_slow_async_io.html + # https://dart.dev/tools/linter-rules/avoid_slow_async_io avoid_slow_async_io: true - # https://dart-lang.github.io/linter/lints/constant_identifier_names.html + # https://dart.dev/tools/linter-rules/constant_identifier_names constant_identifier_names: false # https://github.com/passsy/dart-lint/blob/master/lib/analysis_options.yaml lines_longer_than_80_chars: false - # https://dart-lang.github.io/linter/lints/literal_only_boolean_expressions.html + # https://dart.dev/tools/linter-rules/literal_only_boolean_expressions literal_only_boolean_expressions: true - # https://dart-lang.github.io/linter/lints/omit_local_variable_types.html + # https://dart.dev/tools/linter-rules/omit_local_variable_types omit_local_variable_types: true - # https://dart-lang.github.io/linter/lints/prefer_mixin.html + # https://dart.dev/tools/linter-rules/prefer_mixin prefer_mixin: true prefer_single_quotes: true - # https://dart-lang.github.io/linter/lints/require_trailing_commas.html + # https://dart.dev/tools/linter-rules/require_trailing_commas require_trailing_commas: false # allow java-style comments - # https://dart-lang.github.io/linter/lints/slash_for_doc_comments.html + # https://dart.dev/tools/linter-rules/slash_for_doc_comments slash_for_doc_comments: false # warn if await is missing on calling async func - # https://dart-lang.github.io/linter/lints/unawaited_futures.html + # https://dart.dev/tools/linter-rules/unawaited_futures unawaited_futures: true - # https://dart-lang.github.io/linter/lints/unnecessary_brace_in_string_interps.html + # https://dart.dev/tools/linter-rules/unnecessary_brace_in_string_interps unnecessary_brace_in_string_interps: false - # https://dart-lang.github.io/linter/lints/unnecessary_lambdas.html + # https://dart.dev/tools/linter-rules/unnecessary_lambdas unnecessary_lambdas: true - # https://dart-lang.github.io/linter/lints/unnecessary_late.html + # https://dart.dev/tools/linter-rules/unnecessary_late unnecessary_late: true # allow new keyword - # https://dart-lang.github.io/linter/lints/unnecessary_new.html + # https://dart.dev/tools/linter-rules/unnecessary_new unnecessary_new: false # https://github.com/passsy/dart-lint/blob/master/lib/analysis_options.yaml diff --git a/lib/hotreloader.dart b/lib/hotreloader.dart index 005f84c..6c18c05 100644 --- a/lib/hotreloader.dart +++ b/lib/hotreloader.dart @@ -3,8 +3,6 @@ * SPDX-FileContributor: Sebastian Thomschke, Vegard IT GmbH * SPDX-License-Identifier: Apache-2.0 */ -library; - import 'dart:async'; import 'dart:convert' as convert; import 'dart:io' as io; diff --git a/lib/src/util/docker.dart b/lib/src/util/docker.dart index 6914d5e..b9ba84b 100644 --- a/lib/src/util/docker.dart +++ b/lib/src/util/docker.dart @@ -3,8 +3,6 @@ * SPDX-FileContributor: Sebastian Thomschke, Vegard IT GmbH * SPDX-License-Identifier: Apache-2.0 */ -library; - import 'dart:convert' as convert; import 'dart:io'; diff --git a/lib/src/util/files.dart b/lib/src/util/files.dart index 2d62fca..d0fbc3c 100644 --- a/lib/src/util/files.dart +++ b/lib/src/util/files.dart @@ -3,8 +3,6 @@ * SPDX-FileContributor: Sebastian Thomschke, Vegard IT GmbH * SPDX-License-Identifier: Apache-2.0 */ -library; - import 'dart:convert' as convert; import 'dart:io' as io; diff --git a/lib/src/util/pub.dart b/lib/src/util/pub.dart index 606894e..0ea9b42 100644 --- a/lib/src/util/pub.dart +++ b/lib/src/util/pub.dart @@ -3,8 +3,6 @@ * SPDX-FileContributor: Sebastian Thomschke, Vegard IT GmbH * SPDX-License-Identifier: Apache-2.0 */ -library; - import 'dart:io' as io; import 'dart:isolate' as isolate; import 'package:path/path.dart' as p; diff --git a/lib/src/util/strings.dart b/lib/src/util/strings.dart index 86ee613..85bac14 100644 --- a/lib/src/util/strings.dart +++ b/lib/src/util/strings.dart @@ -3,7 +3,6 @@ * SPDX-FileContributor: Sebastian Thomschke, Vegard IT GmbH * SPDX-License-Identifier: Apache-2.0 */ -library; String substringAfter(final String searchIn, final String searchFor) { if (searchIn.isEmpty) { diff --git a/lib/src/util/vm.dart b/lib/src/util/vm.dart index ed4f890..2c93084 100644 --- a/lib/src/util/vm.dart +++ b/lib/src/util/vm.dart @@ -3,8 +3,6 @@ * SPDX-FileContributor: Sebastian Thomschke, Vegard IT GmbH * SPDX-License-Identifier: Apache-2.0 */ -library; - import 'dart:developer' as dev; import 'package:vm_service/utils.dart' as vms_utils; diff --git a/pubspec.yaml b/pubspec.yaml index 830022d..16bdf77 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ # https://dart.dev/tools/pub/pubspec name: hotreloader -version: 4.1.1-SNAPSHOT +version: 4.2.1-SNAPSHOT description: > Automatic hot code reloader for Dart projects that monitors the source files of a Dart diff --git a/test/hotreloader_test.dart b/test/hotreloader_test.dart index 2d4520a..8d558a7 100644 --- a/test/hotreloader_test.dart +++ b/test/hotreloader_test.dart @@ -3,8 +3,6 @@ * SPDX-FileContributor: Sebastian Thomschke, Vegard IT GmbH * SPDX-License-Identifier: Apache-2.0 */ -library; - import 'dart:async'; import 'dart:io' as io; import 'dart:isolate';