|
| 1 | +include: package:flutter_lints/flutter.yaml |
| 2 | + |
| 3 | +analyzer: |
| 4 | + strong-mode: |
| 5 | + implicit-casts: false |
| 6 | + implicit-dynamic: false |
| 7 | + exclude: |
| 8 | + - "bin/cache/**" |
| 9 | + - "**/*.freezed.dart" |
| 10 | + - "**/*.g.dart" |
| 11 | + - "**/*.mocks.dart" |
| 12 | + - "**/generated/**" |
| 13 | + |
| 14 | +linter: |
| 15 | + rules: |
| 16 | + # Errors |
| 17 | + - avoid_empty_else |
| 18 | + - avoid_relative_lib_imports |
| 19 | + - avoid_returning_null_for_future |
| 20 | + - avoid_slow_async_io |
| 21 | + - avoid_types_as_parameter_names |
| 22 | + - cancel_subscriptions |
| 23 | + - close_sinks |
| 24 | + # - comment_references -- DISABLED: collision with mockito generation |
| 25 | + - control_flow_in_finally |
| 26 | + # - diagnostic_describe_all_properties -- DISABLED: experimental feature |
| 27 | + - empty_statements |
| 28 | + - hash_and_equals |
| 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 | + - prefer_void_to_null |
| 35 | + - test_types_in_equals |
| 36 | + - throw_in_finally |
| 37 | + - unnecessary_statements |
| 38 | + - unrelated_type_equality_checks |
| 39 | + - valid_regexps |
| 40 | + # Style checks |
| 41 | + - always_declare_return_types |
| 42 | + # - always_put_control_body_on_new_line -- DISABLED: DARTFMT INCOMPATIBLE |
| 43 | + - always_put_required_named_parameters_first |
| 44 | + - always_require_non_null_named_parameters |
| 45 | + # - always_specify_types -- DISABLED: LEADS TO FLUFFY CODE |
| 46 | + - annotate_overrides |
| 47 | + # - avoid_annotating_with_dynamic -- DISABLED: Gives false positives for function arguments where it is needed |
| 48 | + # - avoid_as |
| 49 | + - avoid_bool_literals_in_conditional_expressions |
| 50 | + - avoid_catches_without_on_clauses |
| 51 | + - avoid_catching_errors |
| 52 | + - avoid_classes_with_only_static_members |
| 53 | + - avoid_double_and_int_checks |
| 54 | + - avoid_field_initializers_in_const_classes |
| 55 | + # - avoid_function_literals_in_foreach_calls -- DISABLED: forEach is often clearer than for-loop |
| 56 | + - avoid_implementing_value_types |
| 57 | + - avoid_init_to_null |
| 58 | + - avoid_js_rounded_ints |
| 59 | + - avoid_null_checks_in_equality_operators |
| 60 | + - avoid_positional_boolean_parameters |
| 61 | + - avoid_private_typedef_functions |
| 62 | + - avoid_renaming_method_parameters |
| 63 | + - avoid_return_types_on_setters |
| 64 | + - avoid_returning_null |
| 65 | + - avoid_returning_null_for_void |
| 66 | + - avoid_returning_this |
| 67 | + # - avoid_setters_without_getters -- DISABLED: Sometimes it makes sense to have write-only member |
| 68 | + # - avoid_shadowing_type_parameters -- TODO: Enable new option |
| 69 | + - avoid_single_cascade_in_expression_statements |
| 70 | + # - avoid_types_on_closure_parameters -- DISABLED: INCOMPATIBLE WITH IMPLICIT TYPE CASTS DISABLED |
| 71 | + - avoid_unused_constructor_parameters |
| 72 | + - avoid_void_async |
| 73 | + - await_only_futures |
| 74 | + - camel_case_types |
| 75 | + - cascade_invocations |
| 76 | + - constant_identifier_names |
| 77 | + # - curly_braces_in_flow_control_structures -- DISABLED: WE DO NOT WANT THIS |
| 78 | + - directives_ordering |
| 79 | + - empty_catches |
| 80 | + - empty_constructor_bodies |
| 81 | + - file_names |
| 82 | + # - flutter_style_todos -- DISABLED: TOO MUCH? |
| 83 | + - implementation_imports |
| 84 | + - join_return_with_assignment |
| 85 | + - library_names |
| 86 | + - library_prefixes |
| 87 | + # - lines_longer_than_80_chars -- DISABLED: WE DO NOT WANT THIS |
| 88 | + - non_constant_identifier_names |
| 89 | + - null_closures |
| 90 | + - omit_local_variable_types |
| 91 | + # - one_member_abstracts -- DISABLED: OBSTRUCTS OO DESIGN |
| 92 | + - only_throw_errors |
| 93 | + - overridden_fields |
| 94 | + - package_api_docs |
| 95 | + - package_prefixed_library_names |
| 96 | + - parameter_assignments |
| 97 | + - prefer_adjacent_string_concatenation |
| 98 | + - prefer_asserts_in_initializer_lists |
| 99 | + # - prefer_asserts_with_message -- DISABLED: BOOLEAN CONDITIONS ARE GOOD ENOUGH |
| 100 | + - prefer_collection_literals |
| 101 | + - prefer_conditional_assignment |
| 102 | + - prefer_const_constructors |
| 103 | + - prefer_const_constructors_in_immutables |
| 104 | + - prefer_const_declarations |
| 105 | + - prefer_const_literals_to_create_immutables |
| 106 | + - prefer_constructors_over_static_methods |
| 107 | + - prefer_contains |
| 108 | + # - prefer_double_quotes -- DISABLED: This rule is to be supported in a future Dart release |
| 109 | + - prefer_equal_for_default_values |
| 110 | + - prefer_expression_function_bodies |
| 111 | + - prefer_final_fields |
| 112 | + - prefer_final_in_for_each |
| 113 | + - prefer_final_locals |
| 114 | + - prefer_for_elements_to_map_fromIterable |
| 115 | + - prefer_foreach |
| 116 | + - prefer_function_declarations_over_variables |
| 117 | + - prefer_generic_function_type_aliases |
| 118 | + - prefer_if_elements_to_conditional_expressions |
| 119 | + - prefer_initializing_formals |
| 120 | + - prefer_inlined_adds |
| 121 | + # - prefer_int_literals -- DISABLED: ADDED VALUE IS UNCLEAR |
| 122 | + - prefer_interpolation_to_compose_strings |
| 123 | + - prefer_is_empty |
| 124 | + - prefer_is_not_empty |
| 125 | + - prefer_iterable_whereType |
| 126 | + - prefer_mixin |
| 127 | + - prefer_null_aware_operators |
| 128 | + # - prefer_single_quotes -- DISABLED: ADDED VALUE IS UNCLEAR |
| 129 | + - prefer_spread_collections |
| 130 | + - prefer_typing_uninitialized_variables |
| 131 | + # - provide_deprecation_messages -- DISABLED: This rule is to be supported in a future Dart release |
| 132 | + # - public_member_api_docs |
| 133 | + - recursive_getters |
| 134 | + - slash_for_doc_comments |
| 135 | + # - sort_child_properties_last -- This rule is to be supported in a future Dart release |
| 136 | + # - sort_constructors_first -- DISABLED: ADDED VALUE IS UNCLEAR |
| 137 | + # - sort_unnamed_constructors_first -- DISABLED: ADDED VALUE IS UNCLEAR |
| 138 | + # - type_annotate_public_apis -- DISABLED: ADDED VALUE IS UNCLEAR |
| 139 | + - type_init_formals |
| 140 | + - unawaited_futures |
| 141 | + - unnecessary_await_in_return |
| 142 | + - unnecessary_brace_in_string_interps |
| 143 | + - unnecessary_const |
| 144 | + - unnecessary_getters_setters |
| 145 | + - unnecessary_lambdas |
| 146 | + - unnecessary_new |
| 147 | + - unnecessary_null_aware_assignments |
| 148 | + - unnecessary_null_in_if_null_operators |
| 149 | + - unnecessary_overrides |
| 150 | + - unnecessary_parenthesis |
| 151 | + - unnecessary_this |
| 152 | + - use_full_hex_values_for_flutter_colors |
| 153 | + - use_function_type_syntax_for_parameters |
| 154 | + - use_rethrow_when_possible |
| 155 | + - use_setters_to_change_properties |
| 156 | + - use_string_buffers |
| 157 | + - use_to_and_as_if_applicable |
| 158 | + - void_checks |
| 159 | + # Pub Rules |
| 160 | + - package_names |
| 161 | + - sort_pub_dependencies |
0 commit comments