Skip to content

Commit

Permalink
Flutter 3.10, Dart 3 and updated DCM version (#13)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
PiotrMitkowski and PiotrMitkowski authored May 12, 2023
1 parent f3df1cf commit 106c16d
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 13 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`:
Expand All @@ -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:
Expand Down
15 changes: 9 additions & 6 deletions lib/miquido_lints.yaml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
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
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

0 comments on commit 106c16d

Please sign in to comment.