|
1 | | -# Defines a default set of lint rules enforced for |
2 | | -# projects at Google. For details and rationale, |
3 | | -# see https://github.com/dart-lang/pedantic#enabled-lints. |
| 1 | +analyzer: |
| 2 | + exclude: [ lib/**.g.dart, build/** ] |
| 3 | + strong-mode: |
| 4 | + implicit-casts: false |
| 5 | + implicit-dynamic: false |
| 6 | + errors: |
| 7 | + diagnostic_describe_all_properties: warning |
| 8 | + use_key_in_widget_constructors: info |
| 9 | + always_declare_return_types: error |
| 10 | + always_put_control_body_on_new_line: error |
| 11 | + always_put_required_named_parameters_first: error |
| 12 | + always_require_non_null_named_parameters: error |
| 13 | + always_specify_types: error |
| 14 | + annotate_overrides: error |
| 15 | + avoid_as: error |
| 16 | + avoid_catches_without_on_clauses: warning |
| 17 | + avoid_catching_errors: error |
| 18 | + avoid_classes_with_only_static_members: info |
| 19 | + avoid_equals_and_hash_code_on_mutable_classes: error |
| 20 | + avoid_escaping_inner_quotes: warning |
| 21 | + avoid_field_initializers_in_const_classes: error |
| 22 | + avoid_implementing_value_types: error |
| 23 | + avoid_init_to_null: warning |
| 24 | + avoid_null_checks_in_equality_operators: warning |
| 25 | + avoid_positional_boolean_parameters: warning |
| 26 | + avoid_private_typedef_functions: error |
| 27 | + avoid_redundant_argument_values: info |
| 28 | + avoid_renaming_method_parameters: warning |
| 29 | + avoid_return_types_on_setters: info |
| 30 | + avoid_returning_null: warning |
| 31 | + avoid_returning_null_for_void: warning |
| 32 | + avoid_returning_this: info |
| 33 | + avoid_setters_without_getters: warning |
| 34 | + avoid_shadowing_type_parameters: error |
| 35 | + avoid_single_cascade_in_expression_statements: warning |
| 36 | + avoid_unnecessary_containers: error |
| 37 | + avoid_unused_constructor_parameters: error |
| 38 | + avoid_void_async: error |
| 39 | + await_only_futures: warning |
| 40 | + camel_case_extensions: warning |
| 41 | + camel_case_types: error |
| 42 | + cascade_invocations: info |
| 43 | + cast_nullable_to_non_nullable: warning |
| 44 | + constant_identifier_names: warning |
| 45 | + curly_braces_in_flow_control_structures: warning |
| 46 | + directives_ordering: info |
| 47 | + empty_catches: warning |
| 48 | + empty_constructor_bodies: warning |
| 49 | + exhaustive_cases: error |
| 50 | + file_names: error |
| 51 | + flutter_style_todos: warning |
| 52 | + implementation_imports: error |
| 53 | + join_return_with_assignment: warning |
| 54 | + library_names: error |
| 55 | + library_prefixes: error |
| 56 | + lines_longer_than_80_chars: warning |
| 57 | + missing_whitespace_between_adjacent_strings: warning |
| 58 | + no_runtimeType_toString: warning |
| 59 | + non_constant_identifier_names: error |
| 60 | + null_check_on_nullable_type_parameter: error |
| 61 | + null_closures: warning |
| 62 | + one_member_abstracts: warning |
| 63 | + only_throw_errors: error |
| 64 | + overridden_fields: warning |
| 65 | + package_api_docs: error |
| 66 | + parameter_assignments: error |
| 67 | + prefer_adjacent_string_concatenation: warning |
| 68 | + prefer_asserts_in_initializer_lists: warning |
| 69 | + prefer_asserts_with_message: warning |
| 70 | + prefer_collection_literals: warning |
| 71 | + prefer_conditional_assignment: warning |
| 72 | + prefer_const_constructors: error |
| 73 | + prefer_const_constructors_in_immutables: error |
| 74 | + prefer_contains: warning |
| 75 | + prefer_final_fields: warning |
| 76 | + prefer_final_in_for_each: warning |
| 77 | + prefer_final_locals: warning |
| 78 | + prefer_generic_function_type_aliases: warning |
| 79 | + prefer_if_elements_to_conditional_expressions: warning |
| 80 | + prefer_typing_uninitialized_variables: warning |
| 81 | + provide_deprecation_message: error |
| 82 | + public_member_api_docs: error |
| 83 | + recursive_getters: error |
| 84 | + sized_box_for_whitespace: error |
| 85 | + type_annotate_public_apis: error |
| 86 | + use_full_hex_values_for_flutter_colors: warning |
4 | 87 |
|
5 | | -# For lint rules and documentation, see http://dart-lang.github.io/linter/lints. |
6 | | -# Uncomment to specify additional rules. |
7 | 88 | linter: |
8 | 89 | rules: |
9 | | - # DESIGN |
10 | | - - use_to_and_as_if_applicable # prefer |
11 | | - - one_member_abstracts # avoid |
12 | | - - avoid_classes_with_only_static_members # avoid |
13 | | - - prefer_final_fields # prefer |
14 | | - - use_setters_to_change_properties |
15 | | - - avoid_setters_without_getters |
16 | | - - avoid_returning_null # avoid |
17 | | - - avoid_returning_this # avoid |
18 | | - - prefer_typing_uninitialized_variables # prefer |
19 | | - - omit_local_variable_types # avoid |
20 | | - - avoid_return_types_on_setters |
21 | | - - prefer_generic_function_type_aliases |
22 | | - - avoid_private_typedef_functions |
23 | | - - use_function_type_syntax_for_parameters # consider |
24 | | - - avoid_positional_boolean_parameters # avoid |
25 | | - - hash_and_equals |
26 | | - - avoid_null_checks_in_equality_operators |
27 | | - - avoid_types_as_parameter_names |
28 | | - # USAGE |
29 | | - - invalid_use_of_visible_for_testing_member |
30 | | - - avoid_relative_lib_imports # prefer |
31 | | - - prefer_adjacent_string_concatenation |
32 | | - - prefer_interpolation_to_compose_strings # prefer |
33 | | - - unnecessary_brace_in_string_interps # avoid |
34 | | - - prefer_collection_literals |
35 | | - - avoid_function_literals_in_foreach_calls # avoid |
36 | | - - prefer_iterable_whereType |
37 | | - - prefer_function_declarations_over_variables |
38 | | - - unnecessary_lambdas |
39 | | - - prefer_equal_for_default_values |
40 | | - - avoid_init_to_null |
41 | | - - unnecessary_getters_setters |
42 | | - - unnecessary_getters # prefer |
43 | | - - unnecessary_new |
44 | | - - missing_return |
45 | | - #- prefer_expression_function_bodies # consider |
46 | | - - unnecessary_this |
47 | | - - prefer_initializing_formals |
48 | | - - type_init_formals |
49 | | - - empty_constructor_bodies |
50 | | - - unnecessary_const |
51 | | - - avoid_catches_without_on_clauses # avoid |
52 | | - - use_rethrow_when_possible |
53 | | - - implementation_imports |
| 90 | + # ERROR RULES |
| 91 | + - always_use_package_imports |
54 | 92 | - avoid_empty_else |
| 93 | + - avoid_print |
| 94 | + - avoid_relative_lib_imports |
| 95 | + - avoid_returning_null_for_future |
55 | 96 | - avoid_slow_async_io |
| 97 | + - avoid_type_to_string |
| 98 | + - avoid_types_as_parameter_names |
| 99 | + - avoid_web_libraries_in_flutter |
56 | 100 | - cancel_subscriptions |
57 | | - - prefer_contains |
58 | 101 | - close_sinks |
| 102 | + - comment_references |
| 103 | + - control_flow_in_finally |
| 104 | + - diagnostic_describe_all_properties |
| 105 | + - empty_statements |
| 106 | + - hash_and_equals |
59 | 107 | - invariant_booleans |
60 | 108 | - iterable_contains_unrelated_type |
61 | 109 | - list_remove_unrelated_type |
62 | 110 | - literal_only_boolean_expressions |
| 111 | + - no_adjacent_strings_in_list |
63 | 112 | - no_duplicate_case_values |
| 113 | + - no_logic_in_create_state |
| 114 | + - prefer_void_to_null |
64 | 115 | - test_types_in_equals |
65 | 116 | - throw_in_finally |
66 | 117 | - unnecessary_statements |
67 | 118 | - unrelated_type_equality_checks |
68 | | - - dead_code |
69 | | - - unused_import |
70 | | - - unused_element |
71 | | - - unused_local_variable |
72 | | - # STYLE |
73 | | - - camel_case_types |
74 | | - - library_names |
75 | | - - file_names |
76 | | - - library_prefixes |
77 | | - - non_constant_identifier_names |
78 | | - - constant_identifier_names # prefer |
79 | | - - directives_ordering |
80 | | - - lines_longer_than_80_chars # avoid |
81 | | - - curly_braces_in_flow_control_structures |
| 119 | + - use_key_in_widget_constructors |
| 120 | + - valid_regexps |
82 | 121 | - always_declare_return_types |
| 122 | + - always_put_control_body_on_new_line |
83 | 123 | - always_put_required_named_parameters_first |
84 | 124 | - always_require_non_null_named_parameters |
| 125 | + - always_specify_types |
85 | 126 | - annotate_overrides |
86 | | - - avoid_bool_literals_in_conditional_expressions |
| 127 | + - avoid_as |
| 128 | + - avoid_catches_without_on_clauses |
| 129 | + - avoid_catching_errors |
| 130 | + - avoid_classes_with_only_static_members |
| 131 | + - avoid_equals_and_hash_code_on_mutable_classes |
| 132 | + - avoid_escaping_inner_quotes |
87 | 133 | - avoid_field_initializers_in_const_classes |
| 134 | + - avoid_implementing_value_types |
| 135 | + - avoid_init_to_null |
| 136 | + - avoid_null_checks_in_equality_operators |
| 137 | + - avoid_positional_boolean_parameters |
| 138 | + - avoid_private_typedef_functions |
| 139 | + - avoid_redundant_argument_values |
88 | 140 | - avoid_renaming_method_parameters |
| 141 | + - avoid_return_types_on_setters |
| 142 | + - avoid_returning_null |
| 143 | + - avoid_returning_null_for_void |
| 144 | + - avoid_returning_this |
| 145 | + - avoid_setters_without_getters |
| 146 | + - avoid_shadowing_type_parameters |
| 147 | + - avoid_single_cascade_in_expression_statements |
| 148 | + - avoid_unnecessary_containers |
| 149 | + - avoid_unused_constructor_parameters |
| 150 | + - avoid_void_async |
89 | 151 | - await_only_futures |
| 152 | + - camel_case_extensions |
| 153 | + - camel_case_types |
90 | 154 | - cascade_invocations |
| 155 | + - cast_nullable_to_non_nullable |
| 156 | + - constant_identifier_names |
| 157 | + - curly_braces_in_flow_control_structures |
| 158 | + - directives_ordering |
| 159 | + - empty_catches |
| 160 | + - empty_constructor_bodies |
| 161 | + - exhaustive_cases |
| 162 | + - file_names |
| 163 | + - flutter_style_todos |
| 164 | + - implementation_imports |
91 | 165 | - join_return_with_assignment |
| 166 | + - library_names |
| 167 | + - library_prefixes |
| 168 | + - lines_longer_than_80_chars |
| 169 | + - missing_whitespace_between_adjacent_strings |
| 170 | + - no_runtimeType_toString |
| 171 | + - non_constant_identifier_names |
| 172 | + - null_check_on_nullable_type_parameter |
| 173 | + - null_closures |
| 174 | + - one_member_abstracts |
| 175 | + - only_throw_errors |
92 | 176 | - overridden_fields |
93 | | - - prefer_const_constructors_in_immutables |
94 | | - - prefer_const_constructors |
95 | | - - prefer_conditional_assignment |
96 | | - - prefer_asserts_with_message |
| 177 | + - package_api_docs |
| 178 | + - parameter_assignments |
| 179 | + - prefer_adjacent_string_concatenation |
97 | 180 | - prefer_asserts_in_initializer_lists |
| 181 | + - prefer_asserts_with_message |
| 182 | + - prefer_collection_literals |
| 183 | + - prefer_conditional_assignment |
| 184 | + - prefer_const_constructors |
| 185 | + - prefer_const_constructors_in_immutables |
| 186 | + - prefer_const_declarations |
| 187 | + - prefer_const_literals_to_create_immutables |
| 188 | + - prefer_constructors_over_static_methods |
| 189 | + - prefer_contains |
| 190 | + - prefer_double_quotes |
| 191 | + - prefer_equal_for_default_values |
| 192 | + - prefer_final_fields |
98 | 193 | - prefer_final_in_for_each |
99 | 194 | - prefer_final_locals |
100 | | - - prefer_for_elements_to_map_fromIterable |
| 195 | + - prefer_generic_function_type_aliases |
101 | 196 | - prefer_if_elements_to_conditional_expressions |
102 | 197 | - prefer_if_null_operators |
| 198 | + - prefer_initializing_formals |
103 | 199 | - prefer_inlined_adds |
104 | 200 | - prefer_int_literals |
| 201 | + - prefer_interpolation_to_compose_strings |
105 | 202 | - prefer_is_empty |
106 | 203 | - prefer_is_not_empty |
| 204 | + - prefer_is_not_operator |
| 205 | + - prefer_iterable_whereType |
107 | 206 | - prefer_mixin |
108 | 207 | - prefer_null_aware_operators |
109 | 208 | - prefer_spread_collections |
| 209 | + - prefer_typing_uninitialized_variables |
110 | 210 | - provide_deprecation_message |
| 211 | + - public_member_api_docs |
111 | 212 | - recursive_getters |
| 213 | + - sized_box_for_whitespace |
| 214 | + - slash_for_doc_comments |
112 | 215 | - sort_child_properties_last |
113 | | - - sort_constructors_first |
| 216 | + - sort_unnamed_constructors_first |
| 217 | + - tighten_type_of_initializing_formals |
114 | 218 | - type_annotate_public_apis |
| 219 | + - type_init_formals |
115 | 220 | - unnecessary_await_in_return |
| 221 | + - unnecessary_brace_in_string_interps |
| 222 | + - unnecessary_const |
| 223 | + - unnecessary_getters_setters |
| 224 | + - unnecessary_lambdas |
| 225 | + - unnecessary_new |
116 | 226 | - unnecessary_null_aware_assignments |
| 227 | + - unnecessary_null_checks |
117 | 228 | - unnecessary_null_in_if_null_operators |
| 229 | + - unnecessary_nullable_for_final_variable_declarations |
118 | 230 | - unnecessary_overrides |
119 | 231 | - unnecessary_parenthesis |
| 232 | + - unnecessary_raw_strings |
| 233 | + - unnecessary_string_escapes |
| 234 | + - unnecessary_string_interpolations |
| 235 | + - unnecessary_this |
120 | 236 | - use_full_hex_values_for_flutter_colors |
| 237 | + - use_function_type_syntax_for_parameters |
| 238 | + - use_is_even_rather_than_modulo |
| 239 | + - use_late_for_private_fields_and_variables |
| 240 | + - use_raw_strings |
| 241 | + - use_rethrow_when_possible |
121 | 242 | - use_string_buffers |
122 | | - # DOCUMENTATION |
123 | | - - slash_for_doc_comments |
124 | | - - package_api_docs # prefer |
125 | | - - public_member_api_docs # prefer |
126 | | - - comment_references |
127 | | - - invalid_use_of_protected_member |
128 | | - - unawaited_futures |
129 | | - - must_call_super |
130 | | - - unused_field |
| 243 | + - use_to_and_as_if_applicable |
| 244 | + - void_checks |
| 245 | + - sort_pub_dependencies |
131 | 246 |
|
132 | | -analyzer: |
133 | | - exclude: [lib/**.g.dart, test/**.g.dart, flutter_test/**.g.dart, build/**] |
134 | | - strong-mode: |
135 | | - implicit-casts: false |
136 | | - implicit-dynamic: false |
137 | | - errors: |
138 | | - slash_for_doc_comments: warning |
139 | | - package_api_docs: error |
140 | | - public_member_api_docs: error |
141 | | - camel_case_types: warning |
142 | | - library_names: error |
143 | | - file_names: error |
144 | | - library_prefixes: warning |
145 | | - non_constant_identifier_names: warning |
146 | | - directives_ordering: warning |
147 | | - lines_longer_than_80_chars: warning |
148 | | - curly_braces_in_flow_control_structures: error |
149 | | - always_require_non_null_named_parameters: error |
150 | | - avoid_renaming_method_parameters: warning |
151 | | - await_only_futures: warning |
152 | | - cascade_invocations: warning |
153 | | - prefer_const_constructors_in_immutables: error |
154 | | - prefer_asserts_in_initializer_lists: warning |
155 | | - prefer_if_elements_to_conditional_expressions: warning |
156 | | - use_to_and_as_if_applicable: warning |
157 | | - one_member_abstracts: warning |
158 | | - prefer_final_fields: warning |
159 | | - avoid_setters_without_getters: error |
160 | | - prefer_generic_function_type_aliases: error |
161 | | - avoid_private_typedef_functions: warning |
162 | | - avoid_positional_boolean_parameters: warning |
163 | | - hash_and_equals: error |
164 | | - avoid_null_checks_in_equality_operators: warning |
165 | | - prefer_interpolation_to_compose_strings: warning |
166 | | - unnecessary_brace_in_string_interps: warning |
167 | | - prefer_iterable_whereType: warning |
168 | | - unnecessary_lambdas: warning |
169 | | - prefer_equal_for_default_values: warning |
170 | | - avoid_init_to_null: warning |
171 | | - unnecessary_this: warning |
172 | | - prefer_initializing_formals: warning |
173 | | - type_init_formals: warning |
174 | | - empty_constructor_bodies: warning |
175 | | - implementation_imports: error |
176 | | - unnecessary_const: warning |
177 | | - avoid_catches_without_on_clauses: warning |
178 | | - use_rethrow_when_possible: warning |
179 | | - dead_code: error |
180 | | - unused_import: error |
181 | | - unused_element: error |
182 | | - unused_local_variable: error |
183 | | - missing_return: error |
184 | | - invalid_use_of_visible_for_testing_member: error |
185 | | - avoid_slow_async_io: warning |
186 | | - invalid_use_of_protected_member: error |
187 | | - unawaited_futures: warning |
188 | | - type_annotate_public_apis: error |
189 | | - must_call_super: error |
190 | | - unused_field: error |
191 | | - unnecessary_overrides: error |
| 247 | +# Rules links https://dart-lang.github.io/linter/lints/ |
0 commit comments