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
todo: ignore # use separate tooling to display todos (eg Todo Tree in VSCode)
19
+
exclude:
20
+
- '**/*.g.*'
21
+
22
+
dart_code_metrics:
23
+
anti-patterns:
24
+
- long-method
25
+
- long-parameter-list
26
+
metrics:
27
+
cyclomatic-complexity: 20
28
+
maximum-nesting-level: 7
29
+
number-of-parameters: 10
30
+
source-lines-of-code: 100
31
+
metrics-exclude:
32
+
- test/**
33
+
rules:
34
+
- newline-before-return
35
+
- no-boolean-literal-compare
36
+
- no-empty-block
37
+
- prefer-trailing-comma
38
+
- prefer-conditional-expressions
39
+
- no-equal-then-else
40
+
- avoid-non-null-assertion
41
+
6
42
linter:
7
43
rules:
8
44
- always_declare_return_types
9
-
- always_put_control_body_on_new_line
10
-
# - always_put_required_named_parameters_first # not useful for Flutter widgets
11
-
#- always_specify_types # This would enforce to write types literally everywhere.
45
+
# - always_put_control_body_on_new_line # No real benefit. Readability is better without
46
+
# - always_put_required_named_parameters_first # We mostly put optional "Key" first.
47
+
- always_require_non_null_named_parameters
48
+
# - always_specify_types # No - Then we need to add types everywhere
49
+
# - always_use_package_imports # We are using relative Imports inside of the LIB
12
50
- annotate_overrides
13
-
#- avoid_annotating_with_dynamic # Explicit annotation of dynamic as type is preferable. Also exclusive with type_annotate_public_apis
14
-
#- avoid_as - deprecated, breaks lint
51
+
# - avoid_annotating_with_dynamic # We want to be explicit if we do use dynamic
15
52
- avoid_bool_literals_in_conditional_expressions
16
-
#- avoid_catches_without_on_clauses # Do not enable this as enough_mail needs to handle several underlying exceptions and errors
53
+
#- avoid_catches_without_on_clauses
17
54
- avoid_catching_errors
18
-
#- avoid_classes_with_only_static_members # Useful for some non-global helper cases
55
+
#- avoid_classes_with_only_static_members # We follow this approach for DSTextStyles and DSIcons. We can enable it if we change that.
19
56
- avoid_double_and_int_checks
57
+
- avoid_dynamic_calls
20
58
- avoid_empty_else
59
+
- avoid_equals_and_hash_code_on_mutable_classes
60
+
- avoid_escaping_inner_quotes
21
61
- avoid_field_initializers_in_const_classes
22
62
- avoid_function_literals_in_foreach_calls
23
63
- avoid_implementing_value_types
24
64
- avoid_init_to_null
25
65
- avoid_js_rounded_ints
66
+
- avoid_multiple_declarations_per_line
26
67
- avoid_null_checks_in_equality_operators
27
-
- avoid_positional_boolean_parameters
68
+
# - avoid_positional_boolean_parameters # disabled to allow methods that can be directly assigned to ValueChanged<bool> callbacks.
69
+
- avoid_print
28
70
- avoid_private_typedef_functions
29
-
- avoid_renaming_method_parameters
71
+
- avoid_redundant_argument_values
30
72
- avoid_relative_lib_imports
73
+
- avoid_renaming_method_parameters
31
74
- avoid_return_types_on_setters
75
+
- avoid_returning_null
76
+
- avoid_returning_null_for_future
32
77
- avoid_returning_null_for_void
33
78
- avoid_returning_this
34
79
- avoid_setters_without_getters
35
80
- avoid_shadowing_type_parameters
36
81
- avoid_single_cascade_in_expression_statements
37
82
- avoid_slow_async_io
83
+
- avoid_type_to_string
38
84
- avoid_types_as_parameter_names
39
-
- avoid_types_on_closure_parameters
85
+
# - avoid_types_on_closure_parameters # Sometimes it is useful to define the type.
86
+
- avoid_unnecessary_containers
40
87
- avoid_unused_constructor_parameters
41
88
- avoid_void_async
42
-
- avoid_web_libraries_in_flutter
89
+
#- avoid_web_libraries_in_flutter # We currently need them
43
90
- await_only_futures
91
+
- camel_case_extensions
44
92
- camel_case_types
45
93
- cancel_subscriptions
46
94
- cascade_invocations
47
95
- cast_nullable_to_non_nullable
48
96
- close_sinks
49
-
- comment_references
97
+
- collection_methods_unrelated_type
98
+
# - comment_references # We want proper/cross-file linking in the docs
50
99
- constant_identifier_names
51
100
- control_flow_in_finally
52
101
- curly_braces_in_flow_control_structures
53
-
#- diagnostic_describe_all_properties # We do not use diagnostics atm
102
+
- deprecated_consistency
103
+
# - diagnostic_describe_all_properties # We do not use diagnostics atm
54
104
- directives_ordering
105
+
- do_not_use_environment
106
+
- empty_catches
55
107
- empty_constructor_bodies
56
108
- empty_statements
57
-
- empty_catches
109
+
- exhaustive_cases
58
110
- file_names
59
-
#- flutter_style_todos # Flutter todos are to verbose for our requirements.
111
+
- flutter_style_todos
60
112
- hash_and_equals
61
113
- implementation_imports
62
-
- iterable_contains_unrelated_type
63
-
# - join_return_with_assignment # leads to less readable code IMHO
114
+
- join_return_with_assignment
115
+
- leading_newlines_in_multiline_strings
64
116
- library_names
65
117
- library_prefixes
66
118
- lines_longer_than_80_chars
67
-
- list_remove_unrelated_type
68
119
- literal_only_boolean_expressions
120
+
- missing_whitespace_between_adjacent_strings
69
121
- no_adjacent_strings_in_list
122
+
- no_default_cases
70
123
- no_duplicate_case_values
124
+
- no_logic_in_create_state
125
+
- no_runtimeType_toString
71
126
- non_constant_identifier_names
127
+
- null_check_on_nullable_type_parameter
72
128
- null_closures
73
-
- omit_local_variable_types
129
+
#- omit_local_variable_types # Do not enable this. We want to specify the types in lambdas (e.g. to get auto completion).
74
130
- one_member_abstracts
75
131
- only_throw_errors
76
132
- overridden_fields
77
133
- package_api_docs
78
134
- package_names
79
135
- package_prefixed_library_names
80
136
- parameter_assignments
81
-
- prefer_adjacent_string_concatenation
82
137
- prefer_asserts_in_initializer_lists
83
-
- prefer_asserts_with_message
138
+
#- prefer_asserts_with_message # Keep this optional for complex cases but do not require it.
84
139
- prefer_collection_literals
85
140
- prefer_conditional_assignment
86
-
- prefer_const_constructors
87
-
- prefer_const_constructors_in_immutables
141
+
#- prefer_const_constructors # might be something for the future - skip for now.
142
+
#- prefer_const_constructors_in_immutables # might be something for the future - skip for now.
88
143
- prefer_const_declarations
89
144
- prefer_const_literals_to_create_immutables
90
-
- prefer_constructors_over_static_methods
145
+
#- prefer_constructors_over_static_methods # this currently interfers with our current theming approach as we use static methods there to create instances.- prefer_adjacent_string_concatenation
91
146
- prefer_contains
92
147
- prefer_expression_function_bodies
93
148
- prefer_final_fields
@@ -98,12 +153,14 @@ linter:
98
153
- prefer_function_declarations_over_variables
99
154
- prefer_generic_function_type_aliases
100
155
- prefer_if_elements_to_conditional_expressions
156
+
- prefer_if_null_operators
101
157
- prefer_initializing_formals
102
158
- prefer_inlined_adds
103
-
#- prefer_int_literals # more customary to use doubles eg in paddings
0 commit comments