You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The main change is experimenting with replacing `omit_local_variable_types` with `omit_obvious_local_variable_types` and `specify_nonobvious_local_variable_types`. This change should help improve the readability of code (especially for outside contributors) while not being as verbose as `always_specify_types`.
All changes:
- Update license
- Bump min Dart SDK version to 3.7.
- Add `annotate_redeclares` rule
- Add `invalid_runtime_check_with_js_interop_types` rule
- Add `missing_code_block_language_in_doc_comment` rule
- Replace `omit_local_variable_types` with `omit_obvious_local_variable_types` and `specify_nonobvious_local_variable_types` rules
- Add `unsafe_variance` rule
- Add `use_truncating_division` rule
- Remove `package_api_docs` rule (removed in Dart 3.7).
Copy file name to clipboardExpand all lines: packages/celest_lints/lib/library.yaml
+7-2Lines changed: 7 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,7 @@ linter:
12
12
rules:
13
13
- always_declare_return_types # To ensure that functions do not implicitly return dynamic.
14
14
- always_use_package_imports # To ensure consistency and prevent issues when combining with relative imports.
15
+
- annotate_redeclares # To ensure redeclared methods on extension types are properly annotated.
15
16
- avoid_catches_without_on_clauses # To encourage thoughtfulness when introducing catch clauses and to avoid catching Errors unless specifically required.
16
17
- avoid_classes_with_only_static_members # To embrace Dart idioms and prefer top-level functions.
17
18
- avoid_dynamic_calls # To prevent unintentional dynamic dispatch which can lead to preventable runtime errors.
@@ -35,14 +36,15 @@ linter:
35
36
- eol_at_end_of_file # To provide consistency across our repos/languages.
36
37
- flutter_style_todos # To ensure traceability of TODOs.
37
38
- invalid_case_patterns # To prevent invalid case statements.
39
+
- invalid_runtime_check_with_js_interop_types # To prevent runtime issues when compiling to JS.
38
40
- join_return_with_assignment # To improve code readability.
39
41
# - lines_longer_than_80_chars # Too restrictive as a lint, but generally a good rule to follow nonetheless.
42
+
- missing_code_block_language_in_doc_comment # To ensure generated dartdoc integrity.
40
43
- missing_whitespace_between_adjacent_strings # To prevent sentences which are smashedtogether.
41
44
- no_runtimeType_toString # To avoid issues when compiling to Web and improve performance.
42
45
- noop_primitive_operations # To prevent redundancy.
43
-
- omit_local_variable_types # To encourage conciseness and improve code readability.
46
+
- omit_obvious_local_variable_types# To encourage conciseness and improve code readability.
44
47
- only_throw_errors # To ensure downstream exception handling always works.
45
-
- package_api_docs # To ensure public APIs have proper context and explanation.
46
48
- prefer_asserts_in_initializer_lists # To improve code readability.
47
49
- prefer_asserts_with_message # To provide context to developers and users.
48
50
- prefer_const_constructors # To allow for compile-time optimizations.
@@ -56,6 +58,7 @@ linter:
56
58
- prefer_null_aware_method_calls # To improve code readability.
57
59
- prefer_single_quotes # To encourage consistent styling.
58
60
- public_member_api_docs # To provide users with ample context and explanation.
61
+
- specify_nonobvious_local_variable_types # To improve code readability.
59
62
- sort_constructors_first # To provide a consistent style for classes.
60
63
- sort_unnamed_constructors_first # To provide organization and quick exploration.
61
64
- sort_pub_dependencies # To simplify searching a large list.
@@ -67,6 +70,7 @@ linter:
67
70
- unnecessary_breaks # To simplify switch statements.
68
71
- unnecessary_lambdas # To make code more concise.
69
72
- unnecessary_null_checks # To improve code readability.
73
+
- unsafe_variance # To prevent runtime issues with type parameters.
70
74
- use_enums # To encourage use of the enhanced-enums language feature.
71
75
- use_if_null_to_convert_nulls_to_bools # To improve code readability.
72
76
- use_late_for_private_fields_and_variables # To improve code readability.
@@ -77,6 +81,7 @@ linter:
77
81
- use_super_parameters # To improve code readability and prevent redundancy.
78
82
- use_test_throws_matchers # To improve code readability.
79
83
- use_to_and_as_if_applicable # To improve code readability.
84
+
- use_truncating_division # To improve code readability.
80
85
81
86
# Flutter-specific linter rules
82
87
- avoid_unnecessary_containers # To improve code readability.
0 commit comments