From 106c16d705c153c8fb3ba7e01c8f68176c05cfac Mon Sep 17 00:00:00 2001
From: Piotr Mitkowski <piotr.mitkowski1@gmail.com>
Date: Fri, 12 May 2023 09:25:17 +0200
Subject: [PATCH] Flutter 3.10, Dart 3 and updated DCM version (#13)

* Updated DCM version
Removed lint rules deprecated in Dart 3
Added new linter rule from DCM

* Plugin version bump

* Updated changelog

* Added missing space

* PR remarks

* Updated readme

---------

Co-authored-by: piotr.mitkowski <piotr.mitkowski@miquido.com>
---
 CHANGELOG.md           |  6 ++++++
 README.md              |  6 +++---
 lib/miquido_lints.yaml | 15 +++++++++------
 pubspec.yaml           |  8 ++++----
 4 files changed, 22 insertions(+), 13 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index d130243..76306eb 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,9 @@
+## 1.10.0
+* Lints from dart_metrics version 5.7.3
+* Lints for Flutter 3.10.0 and Dart 3.0.0
+* Removed `implicit-casts` and `implicit-dynamic` rules deprecated in Dart 3
+* Added `avoid-substring` rule from dart_code_metrics version 5.7.3
+
 ## 1.0.0
 
 * Lints from dart_metrics version 5.4.0
diff --git a/README.md b/README.md
index 50574ec..6f5604f 100644
--- a/README.md
+++ b/README.md
@@ -24,8 +24,8 @@ And we just looooove lots of lints. :blue_heart:
 For a start please make sure you work with latest version of Flutter & Dart.
 ```yaml
 environment:
-  sdk: ">=2.19.2 <3.0.0"
-  flutter: ^3.7.7
+  sdk: ">=3.0.0 <4.0.0"
+  flutter: ^3.10.0
 ```
 
 Then add a dev dependency in your `pubspec.yaml`:
@@ -40,7 +40,7 @@ or directly in pubspec.yaml
 
 ```yaml
 dev_dependencies:
-  lint_quido: 1.0.0
+  lint_quido: 1.10.0
 ```
 
 At last in `analysis_options.yaml` add:
diff --git a/lib/miquido_lints.yaml b/lib/miquido_lints.yaml
index 56fae2e..3cd2215 100644
--- a/lib/miquido_lints.yaml
+++ b/lib/miquido_lints.yaml
@@ -1,11 +1,6 @@
 analyzer:
   plugins:
     - dart_code_metrics
-
-  # Explanation for this settings are described in Step 3 of this https://dash-overflow.net/articles/getting_started/
-  strong-mode:
-    implicit-casts: false
-    implicit-dynamic: false
   
   exclude:
     - "**/*.g.dart"
@@ -89,6 +84,7 @@ linter:
     - dangling_library_doc_comments
     # - depend_on_referenced_packages - This will make you at some point add all pub.dev to your pubspec file. Maybe suitable for ultra small pet projects with one dependency at max.
     - deprecated_consistency
+    - deprecated_member_use_from_same_package
     # - diagnostic_describe_all_properties - Add unnecessary complexity to code and makes it difficult to read
     - directives_ordering
     # - discarded_futures - do not work well with testing tools and cascade operator
@@ -103,6 +99,8 @@ linter:
     - hash_and_equals
     - implementation_imports
     - implicit_call_tearoffs
+    - implicit_reopen
+    - invalid_case_patterns
     - iterable_contains_unrelated_type
     - join_return_with_assignment
     - leading_newlines_in_multiline_strings
@@ -113,12 +111,14 @@ linter:
     # - lines_longer_than_80_chars - In Miquido there are two teams: 100 or 120. One of them is wrong.
     - list_remove_unrelated_type
     - literal_only_boolean_expressions
+    - matching_super_parameters
     - missing_whitespace_between_adjacent_strings
     - no_adjacent_strings_in_list
     - no_default_cases
     - no_duplicate_case_values
     - no_leading_underscores_for_library_prefixes
     - no_leading_underscores_for_local_identifiers
+    - no_literal_bool_comparisons
     - no_logic_in_create_state
     - no_runtimeType_toString
     - non_constant_identifier_names
@@ -189,9 +189,11 @@ linter:
     - tighten_type_of_initializing_formals
     - type_annotate_public_apis
     - type_init_formals
+    - type_literal_in_constant_pattern
     - unawaited_futures
     - unnecessary_await_in_return
     - unnecessary_brace_in_string_interps
+    - unnecessary_breaks
     - unnecessary_const
     - unnecessary_constructor_name
     # - unnecessary_final - absurd justification for this one
@@ -216,7 +218,7 @@ linter:
     - unreachable_from_main
     - unrelated_type_equality_checks
     - unsafe_html
-    # - use_build_context_synchronously - this is mostly useful in some animations, but most of the time it unnecessary makes code more complex
+    - use_build_context_synchronously
     - use_colored_box
     - use_decorated_box
     - use_enums
@@ -263,6 +265,7 @@ dart_code_metrics:
     # - avoid-passing-async-when-sync-expected - doesn't go well with lambda expressions, onPressed or freezed
     - avoid-redundant-async:
         severity: info
+    - avoid-substring
     # - avoid-throw-in-catch-block - enabling it because of provided justification in our opinion is just flexing
     - avoid-top-level-members-in-tests:
         exclude:
diff --git a/pubspec.yaml b/pubspec.yaml
index 08a576e..190dfab 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,5 +1,5 @@
 name: lint_quido
-version: 1.0.0
+version: 1.10.0
 description: Collection of Flutter lints that we use and follow in Miquido
 repository: https://github.com/miquido/lint_quido
 issue_tracker: https://github.com/miquido/lint_quido/issues
@@ -7,11 +7,11 @@ homepage: https://github.com/miquido/lint_quido
 documentation: https://github.com/miquido/lint_quido
 
 environment:
-  sdk: ">=2.19.2 <3.0.0"
-  flutter: ">=3.7.7"
+  sdk: ">=3.0.0 <4.0.0"
+  flutter: ">=3.10.0"
 
 dependencies:
-  dart_code_metrics: ^5.6.0
+  dart_code_metrics: ^5.7.3
   
   flutter:
     sdk: flutter