Skip to content

Commit

Permalink
update lint rules and fix lint warning
Browse files Browse the repository at this point in the history
  • Loading branch information
sebthom committed Feb 27, 2024
1 parent c63aa39 commit d333805
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 30 deletions.
32 changes: 16 additions & 16 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions lib/hotreloader.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions lib/src/util/docker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 0 additions & 2 deletions lib/src/util/files.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 0 additions & 2 deletions lib/src/util/pub.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion lib/src/util/strings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 0 additions & 2 deletions lib/src/util/vm.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 0 additions & 2 deletions test/hotreloader_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit d333805

Please sign in to comment.