|
1 | | -# This file configures the analyzer, which statically analyzes Dart code to |
2 | | -# check for errors, warnings, and lints. |
3 | | -# |
4 | | -# The issues identified by the analyzer are surfaced in the UI of Dart-enabled |
5 | | -# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be |
6 | | -# invoked from the command line by running `flutter analyze`. |
7 | | - |
8 | | -# The following line activates a set of recommended lints for Flutter apps, |
9 | | -# packages, and plugins designed to encourage good coding practices. |
10 | 1 | include: package:flutter_lints/flutter.yaml |
11 | | - |
12 | | -analyzer: |
13 | | - errors: |
14 | | - # treat missing required parameters as a warning (not a hint) |
15 | | - missing_required_param: warning |
16 | | - # treat missing returns as a warning (not a hint) |
17 | | - missing_return: warning |
18 | | - # allow having TODOs in the code |
19 | | - todo: ignore |
20 | | - # allow self-reference to deprecated members (we do this because otherwise we have |
21 | | - # to annotate every member in every test, assert, etc, when we deprecate something) |
22 | | - deprecated_member_use_from_same_package: ignore |
23 | | - # Ignore imports due to f***ed up import hierarchies. |
24 | | - unnecessary_import: ignore |
25 | | - exclude: |
26 | | - - "bin/cache/**" |
27 | | - # the following two are relative to the stocks example and the flutter package respectively |
28 | | - # see https://github.com/dart-lang/sdk/issues/28463 |
29 | | - - "lib/i18n/messages_*.dart" |
30 | | - - "lib/src/http/**" |
31 | | - |
32 | | -linter: |
33 | | - # The lint rules applied to this project can be customized in the |
34 | | - # section below to disable rules from the `package:flutter_lints/flutter.yaml` |
35 | | - # included above or to enable additional rules. A list of all available lints |
36 | | - # and their documentation is published at |
37 | | - # https://dart-lang.github.io/linter/lints/index.html. |
38 | | - # |
39 | | - # Instead of disabling a lint rule for the entire project in the |
40 | | - # section below, it can also be suppressed for a single line of code |
41 | | - # or a specific dart file by using the `// ignore: name_of_lint` and |
42 | | - # `// ignore_for_file: name_of_lint` syntax on the line or in the file |
43 | | - # producing the lint. |
44 | | - rules: |
45 | | - # avoid_print: false # Uncomment to disable the `avoid_print` rule |
46 | | - # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule |
47 | | - - always_declare_return_types |
48 | | - - always_put_control_body_on_new_line |
49 | | - # - always_put_required_named_parameters_first |
50 | | - # - always_specify_types |
51 | | - - always_use_package_imports |
52 | | - - annotate_overrides |
53 | | - # - avoid_annotating_with_dynamic |
54 | | - - avoid_bool_literals_in_conditional_expressions |
55 | | - # - avoid_catches_without_on_clauses |
56 | | - - avoid_catching_errors |
57 | | - # - avoid_classes_with_only_static_members |
58 | | - - avoid_double_and_int_checks |
59 | | - # - avoid_dynamic_calls |
60 | | - - avoid_empty_else |
61 | | - - avoid_equals_and_hash_code_on_mutable_classes |
62 | | - - avoid_escaping_inner_quotes |
63 | | - - avoid_field_initializers_in_const_classes |
64 | | - - avoid_function_literals_in_foreach_calls |
65 | | - # - avoid_implementing_value_types |
66 | | - - avoid_init_to_null |
67 | | - - avoid_js_rounded_ints |
68 | | - - avoid_multiple_declarations_per_line |
69 | | - # - avoid_null_checks_in_equality_operators |
70 | | - - avoid_positional_boolean_parameters |
71 | | - - avoid_print |
72 | | - - avoid_private_typedef_functions |
73 | | - # - avoid_redundant_argument_values |
74 | | - - avoid_relative_lib_imports |
75 | | - - avoid_renaming_method_parameters |
76 | | - - avoid_return_types_on_setters |
77 | | - - avoid_returning_null_for_void |
78 | | - - avoid_returning_this |
79 | | - - avoid_setters_without_getters |
80 | | - - avoid_shadowing_type_parameters |
81 | | - - avoid_single_cascade_in_expression_statements |
82 | | - - avoid_slow_async_io |
83 | | - - avoid_type_to_string |
84 | | - - avoid_types_as_parameter_names |
85 | | - - avoid_types_on_closure_parameters |
86 | | - - avoid_unnecessary_containers |
87 | | - - avoid_unused_constructor_parameters |
88 | | - - avoid_void_async |
89 | | - - avoid_web_libraries_in_flutter |
90 | | - - await_only_futures |
91 | | - - camel_case_extensions |
92 | | - - camel_case_types |
93 | | - - cancel_subscriptions |
94 | | - # - cascade_invocations |
95 | | - - cast_nullable_to_non_nullable |
96 | | - - close_sinks |
97 | | - - collection_methods_unrelated_type |
98 | | - - comment_references |
99 | | - - constant_identifier_names |
100 | | - - control_flow_in_finally |
101 | | - - curly_braces_in_flow_control_structures |
102 | | - - depend_on_referenced_packages |
103 | | - - deprecated_consistency |
104 | | - # - diagnostic_describe_all_properties |
105 | | - - directives_ordering |
106 | | - - do_not_use_environment |
107 | | - - empty_catches |
108 | | - - empty_constructor_bodies |
109 | | - - empty_statements |
110 | | - - eol_at_end_of_file |
111 | | - - exhaustive_cases |
112 | | - - file_names |
113 | | - - flutter_style_todos |
114 | | - - hash_and_equals |
115 | | - - implementation_imports |
116 | | - - invalid_runtime_check_with_js_interop_types |
117 | | - - join_return_with_assignment |
118 | | - - leading_newlines_in_multiline_strings |
119 | | - - library_names |
120 | | - - library_prefixes |
121 | | - - library_private_types_in_public_api |
122 | | - - lines_longer_than_80_chars |
123 | | - - literal_only_boolean_expressions |
124 | | - - missing_whitespace_between_adjacent_strings |
125 | | - - no_adjacent_strings_in_list |
126 | | - # - no_default_cases |
127 | | - - no_duplicate_case_values |
128 | | - - no_leading_underscores_for_library_prefixes |
129 | | - - no_leading_underscores_for_local_identifiers |
130 | | - - no_logic_in_create_state |
131 | | - - no_runtimeType_toString |
132 | | - - non_constant_identifier_names |
133 | | - - noop_primitive_operations |
134 | | - - null_check_on_nullable_type_parameter |
135 | | - - null_closures |
136 | | - - omit_local_variable_types |
137 | | - - one_member_abstracts |
138 | | - - only_throw_errors |
139 | | - - overridden_fields |
140 | | - - package_api_docs |
141 | | - - package_names |
142 | | - - package_prefixed_library_names |
143 | | - - parameter_assignments |
144 | | - - prefer_adjacent_string_concatenation |
145 | | - - prefer_asserts_in_initializer_lists |
146 | | - - prefer_asserts_with_message |
147 | | - - prefer_collection_literals |
148 | | - - prefer_conditional_assignment |
149 | | - # - prefer_const_constructors |
150 | | - - prefer_const_constructors_in_immutables |
151 | | - # - prefer_const_declarations |
152 | | - # - prefer_const_literals_to_create_immutables |
153 | | - - prefer_constructors_over_static_methods |
154 | | - - prefer_contains |
155 | | - # - prefer_double_quotes |
156 | | - - prefer_expression_function_bodies |
157 | | - - prefer_final_fields |
158 | | - - prefer_final_in_for_each |
159 | | - - prefer_final_locals |
160 | | - # - prefer_final_parameters |
161 | | - - prefer_for_elements_to_map_fromIterable |
162 | | - - prefer_foreach |
163 | | - - prefer_function_declarations_over_variables |
164 | | - - prefer_generic_function_type_aliases |
165 | | - - prefer_if_elements_to_conditional_expressions |
166 | | - - prefer_if_null_operators |
167 | | - - prefer_initializing_formals |
168 | | - - prefer_inlined_adds |
169 | | - - prefer_int_literals |
170 | | - - prefer_interpolation_to_compose_strings |
171 | | - - prefer_is_empty |
172 | | - - prefer_is_not_empty |
173 | | - - prefer_is_not_operator |
174 | | - - prefer_iterable_whereType |
175 | | - - prefer_mixin |
176 | | - - prefer_null_aware_method_calls |
177 | | - - prefer_null_aware_operators |
178 | | - # - prefer_relative_imports |
179 | | - - prefer_single_quotes |
180 | | - - prefer_spread_collections |
181 | | - - prefer_typing_uninitialized_variables |
182 | | - - prefer_void_to_null |
183 | | - - provide_deprecation_message |
184 | | - # - public_member_api_docs |
185 | | - - recursive_getters |
186 | | - - require_trailing_commas |
187 | | - - sized_box_for_whitespace |
188 | | - - slash_for_doc_comments |
189 | | - - sort_child_properties_last |
190 | | - # - sort_constructors_first |
191 | | - - sort_pub_dependencies |
192 | | - - sort_unnamed_constructors_first |
193 | | - - test_types_in_equals |
194 | | - - throw_in_finally |
195 | | - - tighten_type_of_initializing_formals |
196 | | - - type_annotate_public_apis |
197 | | - - type_init_formals |
198 | | - - unawaited_futures |
199 | | - - unnecessary_await_in_return |
200 | | - - unnecessary_brace_in_string_interps |
201 | | - - unnecessary_const |
202 | | - - unnecessary_constructor_name |
203 | | - # - unnecessary_final |
204 | | - - unnecessary_getters_setters |
205 | | - - unnecessary_lambdas |
206 | | - - unnecessary_late |
207 | | - - unnecessary_library_name |
208 | | - - unnecessary_new |
209 | | - - unnecessary_null_aware_assignments |
210 | | - - unnecessary_null_checks |
211 | | - - unnecessary_null_in_if_null_operators |
212 | | - - unnecessary_nullable_for_final_variable_declarations |
213 | | - - unnecessary_overrides |
214 | | - - unnecessary_parenthesis |
215 | | - - unnecessary_raw_strings |
216 | | - - unnecessary_statements |
217 | | - - unnecessary_string_escapes |
218 | | - - unnecessary_string_interpolations |
219 | | - - unnecessary_this |
220 | | - - unrelated_type_equality_checks |
221 | | - - unsafe_html |
222 | | - - use_build_context_synchronously |
223 | | - - use_full_hex_values_for_flutter_colors |
224 | | - - use_function_type_syntax_for_parameters |
225 | | - - use_if_null_to_convert_nulls_to_bools |
226 | | - - use_is_even_rather_than_modulo |
227 | | - - use_key_in_widget_constructors |
228 | | - - use_late_for_private_fields_and_variables |
229 | | - - use_named_constants |
230 | | - - use_raw_strings |
231 | | - - use_rethrow_when_possible |
232 | | - - use_setters_to_change_properties |
233 | | - - use_string_buffers |
234 | | - - use_test_throws_matchers |
235 | | - - use_to_and_as_if_applicable |
236 | | - - valid_regexps |
237 | | - - void_checks |
238 | | - |
239 | | -# Additional information about this file can be found at |
240 | | -# https://dart.dev/guides/language/analysis-options |
0 commit comments