|
| 1 | +analyzer: |
| 2 | + exclude: [build/**, lib/**.freezed.dart, lib/**.g.dart] |
| 3 | + |
| 4 | + # Currently doesn't work with analyzer out of the box |
| 5 | + # https://github.com/dart-code-checker/dart-code-metrics/issues/313 |
| 6 | + plugins: |
| 7 | + - dart_code_metrics |
| 8 | + |
| 9 | + strong-mode: |
| 10 | + implicit-casts: false |
| 11 | + implicit-dynamic: false |
| 12 | + |
| 13 | + errors: |
| 14 | + close_sinks: ignore |
| 15 | + missing_required_param: error |
| 16 | + missing_return: error |
| 17 | + |
| 18 | +linter: |
| 19 | + rules: |
| 20 | + - always_declare_return_types |
| 21 | + - always_require_non_null_named_parameters |
| 22 | + - always_use_package_imports |
| 23 | + - annotate_overrides |
| 24 | + - avoid_bool_literals_in_conditional_expressions |
| 25 | + - avoid_catching_errors |
| 26 | + - avoid_double_and_int_checks |
| 27 | + - avoid_dynamic_calls |
| 28 | + - avoid_empty_else |
| 29 | + - avoid_equals_and_hash_code_on_mutable_classes |
| 30 | + - avoid_escaping_inner_quotes |
| 31 | + - avoid_field_initializers_in_const_classes |
| 32 | + - avoid_function_literals_in_foreach_calls |
| 33 | + - avoid_init_to_null |
| 34 | + - avoid_js_rounded_ints |
| 35 | + - avoid_null_checks_in_equality_operators |
| 36 | + - avoid_positional_boolean_parameters |
| 37 | + - avoid_print |
| 38 | + - avoid_private_typedef_functions |
| 39 | + - avoid_redundant_argument_values |
| 40 | + - avoid_relative_lib_imports |
| 41 | + - avoid_renaming_method_parameters |
| 42 | + - avoid_return_types_on_setters |
| 43 | + - avoid_returning_null |
| 44 | + - avoid_returning_null_for_future |
| 45 | + - avoid_returning_null_for_void |
| 46 | + - avoid_returning_this |
| 47 | + - avoid_setters_without_getters |
| 48 | + - avoid_shadowing_type_parameters |
| 49 | + - avoid_single_cascade_in_expression_statements |
| 50 | + - avoid_slow_async_io |
| 51 | + - avoid_type_to_string |
| 52 | + - avoid_types_as_parameter_names |
| 53 | + - avoid_unnecessary_containers |
| 54 | + - avoid_unused_constructor_parameters |
| 55 | + - avoid_void_async |
| 56 | + - avoid_web_libraries_in_flutter |
| 57 | + - await_only_futures |
| 58 | + - camel_case_extensions |
| 59 | + - camel_case_types |
| 60 | + - cancel_subscriptions |
| 61 | + - cascade_invocations |
| 62 | + - cast_nullable_to_non_nullable |
| 63 | + - comment_references |
| 64 | + - conditional_uri_does_not_exist |
| 65 | + - constant_identifier_names |
| 66 | + - control_flow_in_finally |
| 67 | + - curly_braces_in_flow_control_structures |
| 68 | + - deprecated_consistency |
| 69 | + - directives_ordering |
| 70 | + - empty_catches |
| 71 | + - empty_constructor_bodies |
| 72 | + - empty_statements |
| 73 | + - eol_at_end_of_file |
| 74 | + - exhaustive_cases |
| 75 | + - file_names |
| 76 | + - flutter_style_todos |
| 77 | + - hash_and_equals |
| 78 | + - implementation_imports |
| 79 | + - invariant_booleans |
| 80 | + - iterable_contains_unrelated_type |
| 81 | + - join_return_with_assignment |
| 82 | + - leading_newlines_in_multiline_strings |
| 83 | + - library_names |
| 84 | + - library_prefixes |
| 85 | + - library_private_types_in_public_api |
| 86 | + - lines_longer_than_80_chars |
| 87 | + - list_remove_unrelated_type |
| 88 | + - literal_only_boolean_expressions |
| 89 | + - missing_whitespace_between_adjacent_strings |
| 90 | + - no_adjacent_strings_in_list |
| 91 | + - no_default_cases |
| 92 | + - no_duplicate_case_values |
| 93 | + - no_logic_in_create_state |
| 94 | + - no_runtimeType_toString |
| 95 | + - non_constant_identifier_names |
| 96 | + - noop_primitive_operations |
| 97 | + - null_check_on_nullable_type_parameter |
| 98 | + - null_closures |
| 99 | + - omit_local_variable_types |
| 100 | + - one_member_abstracts |
| 101 | + - only_throw_errors |
| 102 | + - overridden_fields |
| 103 | + - package_api_docs |
| 104 | + - package_names |
| 105 | + - package_prefixed_library_names |
| 106 | + - parameter_assignments |
| 107 | + - prefer_adjacent_string_concatenation |
| 108 | + - prefer_asserts_in_initializer_lists |
| 109 | + - prefer_asserts_with_message |
| 110 | + - prefer_collection_literals |
| 111 | + - prefer_conditional_assignment |
| 112 | + - prefer_const_constructors |
| 113 | + - prefer_const_constructors_in_immutables |
| 114 | + - prefer_const_declarations |
| 115 | + - prefer_const_literals_to_create_immutables |
| 116 | + - prefer_constructors_over_static_methods |
| 117 | + - prefer_contains |
| 118 | + - prefer_equal_for_default_values |
| 119 | + - prefer_final_fields |
| 120 | + - prefer_final_in_for_each |
| 121 | + - prefer_final_locals |
| 122 | + - prefer_for_elements_to_map_fromIterable |
| 123 | + - prefer_function_declarations_over_variables |
| 124 | + - prefer_generic_function_type_aliases |
| 125 | + - prefer_if_elements_to_conditional_expressions |
| 126 | + - prefer_if_null_operators |
| 127 | + - prefer_initializing_formals |
| 128 | + - prefer_inlined_adds |
| 129 | + - prefer_int_literals |
| 130 | + - prefer_interpolation_to_compose_strings |
| 131 | + - prefer_is_empty |
| 132 | + - prefer_is_not_empty |
| 133 | + - prefer_is_not_operator |
| 134 | + - prefer_iterable_whereType |
| 135 | + - prefer_null_aware_operators |
| 136 | + - prefer_null_aware_method_calls |
| 137 | + - prefer_single_quotes |
| 138 | + - prefer_spread_collections |
| 139 | + - prefer_typing_uninitialized_variables |
| 140 | + - prefer_void_to_null |
| 141 | + - provide_deprecation_message |
| 142 | + - public_member_api_docs |
| 143 | + - recursive_getters |
| 144 | + - require_trailing_commas |
| 145 | + - secure_pubspec_urls |
| 146 | + - sized_box_for_whitespace |
| 147 | + - sized_box_shrink_expand |
| 148 | + - slash_for_doc_comments |
| 149 | + - sort_child_properties_last |
| 150 | + - sort_constructors_first |
| 151 | + - sort_pub_dependencies |
| 152 | + - sort_unnamed_constructors_first |
| 153 | + - test_types_in_equals |
| 154 | + - throw_in_finally |
| 155 | + - tighten_type_of_initializing_formals |
| 156 | + - type_annotate_public_apis |
| 157 | + - type_init_formals |
| 158 | + - unawaited_futures |
| 159 | + - unnecessary_await_in_return |
| 160 | + - unnecessary_brace_in_string_interps |
| 161 | + - unnecessary_const |
| 162 | + - unnecessary_constructor_name |
| 163 | + - unnecessary_getters_setters |
| 164 | + - unnecessary_lambdas |
| 165 | + - unnecessary_late |
| 166 | + - unnecessary_new |
| 167 | + - unnecessary_null_aware_assignments |
| 168 | + - unnecessary_null_checks |
| 169 | + - unnecessary_null_in_if_null_operators |
| 170 | + - unnecessary_nullable_for_final_variable_declarations |
| 171 | + - unnecessary_overrides |
| 172 | + - unnecessary_parenthesis |
| 173 | + - unnecessary_raw_strings |
| 174 | + - unnecessary_statements |
| 175 | + - unnecessary_string_escapes |
| 176 | + - unnecessary_string_interpolations |
| 177 | + - unnecessary_this |
| 178 | + - unrelated_type_equality_checks |
| 179 | + - use_build_context_synchronously |
| 180 | + - use_colored_box |
| 181 | + - use_decorated_box |
| 182 | + - use_enums |
| 183 | + - use_full_hex_values_for_flutter_colors |
| 184 | + - use_function_type_syntax_for_parameters |
| 185 | + - use_is_even_rather_than_modulo |
| 186 | + - use_key_in_widget_constructors |
| 187 | + - use_late_for_private_fields_and_variables |
| 188 | + - use_named_constants |
| 189 | + - use_raw_strings |
| 190 | + - use_rethrow_when_possible |
| 191 | + - use_setters_to_change_properties |
| 192 | + - use_string_buffers |
| 193 | + - use_super_parameters |
| 194 | + - use_to_and_as_if_applicable |
| 195 | + - valid_regexps |
| 196 | + - void_checks |
| 197 | + |
| 198 | +dart_code_metrics: |
| 199 | + anti-patterns: |
| 200 | + - long-method |
| 201 | + - long-parameter-list |
| 202 | + metrics: |
| 203 | + cyclomatic-complexity: 20 |
| 204 | + maximum-nesting-level: 5 |
| 205 | + number-of-parameters: 4 |
| 206 | + source-lines-of-code: 50 |
| 207 | + metrics-exclude: |
| 208 | + - test/** |
| 209 | + - lib/**/*.g.dart |
| 210 | + - lib/**/*.freezed.dart |
| 211 | + rules: |
| 212 | + - avoid-global-state |
| 213 | + - avoid-nested-conditional-expressions: |
| 214 | + acceptable-level: 2 |
| 215 | + - avoid-returning-widgets |
| 216 | + - avoid-wrapping-in-padding |
| 217 | + - double-literal-format |
| 218 | + - format-comment |
| 219 | + - no-boolean-literal-compare |
| 220 | + - no-empty-block |
| 221 | + - no-equal-then-else |
| 222 | + - no-object-declaration |
| 223 | + - prefer-async-await |
| 224 | + - prefer-commenting-analyzer-ignores |
| 225 | + - prefer-conditional-expressions |
| 226 | + - prefer-extracting-callbacks |
| 227 | + - prefer-first |
| 228 | + - prefer-immediate-return |
| 229 | + - prefer-last |
| 230 | + - prefer-match-file-name: |
| 231 | + exclude: |
| 232 | + - test/** |
| 233 | + - prefer-single-widget-per-file: |
| 234 | + ignore-private-widgets: true |
| 235 | + - prefer-trailing-comma |
0 commit comments