1
+ include : all_lint_rules.yaml
2
+
1
3
analyzer :
2
- plugins :
3
- - dart_code_metrics
4
+ language :
5
+ strict-casts : false
6
+ strict-inference : true
7
+ strict-raw-types : true
8
+ errors :
9
+ # Otherwise cause the import of all_lint_rules to warn because of some rules conflicts.
10
+ # We explicitly enabled even conflicting rules and are fixing the conflict
11
+ # in this file.
12
+ included_file_warning : ignore
4
13
exclude :
5
- - packages/*/lib/**/*.pb.dart
6
- - packages/*/lib/**/*.pbenum.dart
7
- - packages/*/lib/**/*.pbjson.dart
8
- - packages/*/lib/**/*.pbserver.dart
9
- - packages/*/lib/**/*.pbtwirp.dart
10
- - packages/*/lib/**/*.g.dart
11
- - packages/*/lib/**/*.freezed.dart
14
+ # exclude all the generated files
15
+ - packages/*/lib/**/*.*.dart
16
+
12
17
13
18
linter :
14
19
rules :
15
- # these rules are documented on and in the same order as
16
- # the Dart Lint rules page to make maintenance easier
17
- # https://github.com/dart-lang/linter/blob/master/example/all.yaml
18
- - always_use_package_imports
19
- - avoid_empty_else
20
- - avoid_relative_lib_imports
21
- - avoid_slow_async_io
22
- - avoid_types_as_parameter_names
23
- - cancel_subscriptions
24
- - close_sinks
25
- - control_flow_in_finally
26
- - empty_statements
27
- - hash_and_equals
28
- - invariant_booleans
29
- - iterable_contains_unrelated_type
30
- - list_remove_unrelated_type
31
- - literal_only_boolean_expressions
32
- - no_adjacent_strings_in_list
33
- - no_duplicate_case_values
34
- - no_logic_in_create_state
35
- - prefer_void_to_null
36
- - test_types_in_equals
37
- - throw_in_finally
38
- - unnecessary_statements
39
- - unrelated_type_equality_checks
40
- - omit_local_variable_types
41
- - use_key_in_widget_constructors
42
- - valid_regexps
43
- - always_declare_return_types
44
- - always_require_non_null_named_parameters
45
- - annotate_overrides
46
- - avoid_bool_literals_in_conditional_expressions
47
- - avoid_catching_errors
48
- - avoid_init_to_null
49
- - avoid_null_checks_in_equality_operators
50
- - avoid_positional_boolean_parameters
51
- - avoid_private_typedef_functions
52
- - avoid_redundant_argument_values
53
- - avoid_return_types_on_setters
54
- - avoid_returning_null_for_void
55
- - avoid_shadowing_type_parameters
56
- - avoid_single_cascade_in_expression_statements
57
- - avoid_unnecessary_containers
58
- - avoid_unused_constructor_parameters
59
- - await_only_futures
60
- - camel_case_extensions
61
- - camel_case_types
62
- - cascade_invocations
63
-
64
- - constant_identifier_names
65
- - curly_braces_in_flow_control_structures
66
- - directives_ordering
67
- - empty_catches
68
- - empty_constructor_bodies
69
- - exhaustive_cases
70
- - file_names
71
- - implementation_imports
72
- - join_return_with_assignment
73
- - leading_newlines_in_multiline_strings
74
- - library_names
75
- - library_prefixes
76
- - lines_longer_than_80_chars
77
- - missing_whitespace_between_adjacent_strings
78
- - non_constant_identifier_names
79
- - null_closures
80
- - one_member_abstracts
81
- - only_throw_errors
82
- - package_api_docs
83
- - package_prefixed_library_names
84
- - parameter_assignments
85
- - prefer_adjacent_string_concatenation
86
- - prefer_asserts_in_initializer_lists
87
- - prefer_asserts_with_message
88
- - prefer_collection_literals
89
- - prefer_conditional_assignment
90
- - prefer_const_constructors
91
- - prefer_const_constructors_in_immutables
92
- - prefer_const_declarations
93
- - prefer_const_literals_to_create_immutables
94
- - prefer_constructors_over_static_methods
95
- - prefer_contains
96
- - prefer_equal_for_default_values
97
- - prefer_final_fields
98
- - prefer_final_in_for_each
99
- - prefer_final_locals
100
- - prefer_function_declarations_over_variables
101
- - prefer_generic_function_type_aliases
102
- - prefer_if_elements_to_conditional_expressions
103
- - prefer_if_null_operators
104
- - prefer_initializing_formals
105
- - prefer_inlined_adds
106
- - prefer_int_literals
107
- - prefer_interpolation_to_compose_strings
108
- - prefer_is_empty
109
- - prefer_is_not_empty
110
- - prefer_is_not_operator
111
- - prefer_null_aware_operators
112
- - prefer_single_quotes
113
- - prefer_spread_collections
114
- - prefer_typing_uninitialized_variables
115
- - provide_deprecation_message
116
- - public_member_api_docs
117
- - recursive_getters
118
- - sized_box_for_whitespace
119
- - slash_for_doc_comments
120
- - sort_child_properties_last
121
- - sort_constructors_first
122
- - sort_unnamed_constructors_first
123
-
124
- - type_annotate_public_apis
125
- - type_init_formals
126
- - unnecessary_await_in_return
127
- - unnecessary_brace_in_string_interps
128
- - unnecessary_const
129
- - unnecessary_getters_setters
130
- - unnecessary_lambdas
131
- - unnecessary_new
132
- - unnecessary_null_aware_assignments
133
- - unnecessary_null_in_if_null_operators
134
- - unnecessary_nullable_for_final_variable_declarations
135
- - unnecessary_parenthesis
136
- - unnecessary_raw_strings
137
- - unnecessary_string_escapes
138
- - unnecessary_string_interpolations
139
- - unnecessary_this
140
- - use_is_even_rather_than_modulo
141
- - use_late_for_private_fields_and_variables
142
- - use_rethrow_when_possible
143
- - use_setters_to_change_properties
144
- - use_to_and_as_if_applicable
145
- - package_names
146
- - sort_pub_dependencies
147
-
148
- - cast_nullable_to_non_nullable
149
- - unnecessary_null_checks
150
- - tighten_type_of_initializing_formals
151
- - null_check_on_nullable_type_parameter
152
-
153
- - conditional_uri_does_not_exist
154
- - secure_pubspec_urls
155
- - sized_box_shrink_expand
156
- - unnecessary_constructor_name
157
- - unnecessary_late
158
- - use_colored_box
159
- - use_decorated_box
160
- - use_enums
161
- - use_super_parameters
162
- - avoid_escaping_inner_quotes
163
- - unnecessary_overrides
164
- - prefer_null_aware_method_calls
165
- - use_named_constants
166
- - use_raw_strings
167
-
168
- # https://dartcodemetrics.dev/docs/getting-started/introduction
169
- dart_code_metrics :
170
- rules :
171
- # Dart Specific
172
- - binary-expression-operand-order
173
- - double-literal-format
174
- - no-boolean-literal-compare
175
- - no-equal-then-else
176
- - no-empty-block :
177
- exclude :
178
- - packages/*/test/**
179
- - prefer-trailing-comma :
180
- exclude :
181
- - packages/*/test/**
182
-
183
- # Flutter specific
184
- - always-remove-listener
185
- - avoid-unnecessary-setstate
20
+ # # Disabled rules because the repository doesn't respect them (yet)
21
+ avoid_setters_without_getters : false
22
+ discarded_futures : false
23
+
24
+ # ############
25
+
26
+ # TODO: re-enable documentation rule and fix issues.
27
+ public_member_api_docs : false
28
+
29
+ always_put_control_body_on_new_line : false
30
+
31
+ # Does not always make code more readable.
32
+ cascade_invocations : false
33
+
34
+ # Conflicts with `prefer_single_quotes`
35
+ # Single quotes are easier to type and don't compromise on readability.
36
+ prefer_double_quotes : false
37
+
38
+ # Conflicts with `omit_local_variable_types` and other rules.
39
+ # As per Dart guidelines, we want to avoid unnecessary types to make the code
40
+ # more readable.
41
+ # See https://dart.dev/guides/language/effective-dart/design#avoid-type-annotating-initialized-local-variables
42
+ always_specify_types : false
43
+
44
+ # Incompatible with `prefer_final_locals`
45
+ # Having immutable local variables makes larger functions more predictable,
46
+ # so we will use `prefer_final_locals` instead.
47
+ unnecessary_final : false
48
+
49
+ # Not quite suitable for Flutter, which may have a `build` method with a single
50
+ # return, but that return is still complex enough that a "body" is worth it.
51
+ prefer_expression_function_bodies : false
52
+
53
+ # Conflicts with the convention used by flutter, which puts `Key key`
54
+ # and `@required Widget child` last.
55
+ always_put_required_named_parameters_first : false
56
+
57
+ # `as` is not that bad (especially with the upcoming non-nullable types).
58
+ # Explicit exceptions is better than implicit exceptions.
59
+ avoid_as : false
60
+
61
+ # This project doesn't use Flutter-style todos
62
+ flutter_style_todos : false
63
+
64
+ # There are situations where we voluntarily want to catch everything,
65
+ # especially as a library.
66
+ avoid_catches_without_on_clauses : false
67
+
68
+ # Boring as it sometimes force a line of 81 characters to be split in two.
69
+ # As long as we try to respect that 80 characters limit, going slightly
70
+ # above is fine.
71
+ lines_longer_than_80_chars : false
72
+
73
+ # Conflicts with disabling `implicit-dynamic`
74
+ avoid_annotating_with_dynamic : false
75
+
76
+ # conflicts with `prefer_relative_imports`
77
+ always_use_package_imports : false
78
+
79
+ # False positive, null checks don't need a message
80
+ prefer_asserts_with_message : false
81
+
82
+ # Cumbersome with `context.select`
83
+ avoid_types_on_closure_parameters : false
84
+
85
+ # Too many false positive (builders)
86
+ diagnostic_describe_all_properties : false
87
+
88
+ # Not a common style and would add a lot of verbosity to function signature.
89
+ # 'parameter_assignments' already enforces this to an extent.
90
+ prefer_final_parameters : false
0 commit comments