|
| 1 | +include: package:lints/recommended.yaml |
| 2 | + |
| 3 | +analyzer: |
| 4 | + exclude: |
| 5 | + # Build |
| 6 | + - "build/**" |
| 7 | + # Tests |
| 8 | + - "test/**.mocks.dart" |
| 9 | + - ".test_coverage.dart" |
| 10 | + - "coverage/**" |
| 11 | + # Assets |
| 12 | + - "assets/**" |
| 13 | + # Generated |
| 14 | + - "lib/src/common/localization/generated/**" |
| 15 | + - "lib/src/common/constants/pubspec.yaml.g.dart" |
| 16 | + - "lib/src/common/model/generated/**" |
| 17 | + - "**.g.dart" |
| 18 | + - "**.gql.dart" |
| 19 | + - "**.freezed.dart" |
| 20 | + - "**.config.dart" |
| 21 | + - "**.mocks.dart" |
| 22 | + - "**.gen.dart" |
| 23 | + - "**.pb.dart" |
| 24 | + - "**.pbenum.dart" |
| 25 | + - "**.pbjson.dart" |
| 26 | + # Flutter Version Manager |
| 27 | + - ".fvm/**" |
| 28 | + # Tools |
| 29 | + #- "tool/**" |
| 30 | + - "scripts/**" |
| 31 | + - ".dart_tool/**" |
| 32 | + # Platform |
| 33 | + - "ios/**" |
| 34 | + - "android/**" |
| 35 | + - "web/**" |
| 36 | + - "macos/**" |
| 37 | + - "windows/**" |
| 38 | + - "linux/**" |
| 39 | + |
| 40 | + # Enable the following options to enable strong mode. |
| 41 | + language: |
| 42 | + strict-casts: true |
| 43 | + strict-raw-types: true |
| 44 | + strict-inference: true |
| 45 | + |
| 46 | + errors: |
| 47 | + # Allow having TODOs in the code |
| 48 | + todo: ignore |
| 49 | + |
| 50 | + # Info |
| 51 | + directives_ordering: info |
| 52 | + always_declare_return_types: info |
| 53 | + |
| 54 | + # Warning |
| 55 | + unsafe_html: warning |
| 56 | + missing_return: warning |
| 57 | + missing_required_param: warning |
| 58 | + no_logic_in_create_state: warning |
| 59 | + empty_catches: warning |
| 60 | + |
| 61 | + # Error |
| 62 | + always_use_package_imports: error |
| 63 | + avoid_relative_lib_imports: error |
| 64 | + avoid_slow_async_io: error |
| 65 | + avoid_types_as_parameter_names: error |
| 66 | + valid_regexps: error |
| 67 | + always_require_non_null_named_parameters: error |
| 68 | + |
| 69 | +linter: |
| 70 | + rules: |
| 71 | + # Public packages |
| 72 | + #public_member_api_docs: true |
| 73 | + #lines_longer_than_80_chars: true |
| 74 | + |
| 75 | + # Enabling rules |
| 76 | + always_use_package_imports: true |
| 77 | + avoid_relative_lib_imports: true |
| 78 | + |
| 79 | + # Disable rules |
| 80 | + sort_pub_dependencies: false |
| 81 | + prefer_relative_imports: false |
| 82 | + prefer_final_locals: false |
| 83 | + avoid_escaping_inner_quotes: false |
| 84 | + curly_braces_in_flow_control_structures: false |
| 85 | + one_member_abstracts: false |
| 86 | + |
| 87 | + # Enabled |
| 88 | + use_named_constants: true |
| 89 | + unnecessary_constructor_name: true |
| 90 | + sort_constructors_first: true |
| 91 | + exhaustive_cases: true |
| 92 | + sort_unnamed_constructors_first: true |
| 93 | + type_literal_in_constant_pattern: true |
| 94 | + always_put_required_named_parameters_first: true |
| 95 | + avoid_annotating_with_dynamic: true |
| 96 | + avoid_bool_literals_in_conditional_expressions: true |
| 97 | + avoid_double_and_int_checks: true |
| 98 | + avoid_field_initializers_in_const_classes: true |
| 99 | + avoid_implementing_value_types: true |
| 100 | + avoid_js_rounded_ints: true |
| 101 | + avoid_print: true |
| 102 | + avoid_renaming_method_parameters: true |
| 103 | + avoid_returning_null_for_void: true |
| 104 | + avoid_single_cascade_in_expression_statements: true |
| 105 | + avoid_slow_async_io: true |
| 106 | + avoid_unnecessary_containers: true |
| 107 | + avoid_unused_constructor_parameters: true |
| 108 | + avoid_void_async: true |
| 109 | + await_only_futures: true |
| 110 | + cancel_subscriptions: true |
| 111 | + cascade_invocations: true |
| 112 | + close_sinks: true |
| 113 | + control_flow_in_finally: true |
| 114 | + empty_statements: true |
| 115 | + collection_methods_unrelated_type: true |
| 116 | + join_return_with_assignment: true |
| 117 | + leading_newlines_in_multiline_strings: true |
| 118 | + literal_only_boolean_expressions: true |
| 119 | + missing_whitespace_between_adjacent_strings: true |
| 120 | + no_adjacent_strings_in_list: true |
| 121 | + no_logic_in_create_state: true |
| 122 | + no_runtimeType_toString: true |
| 123 | + only_throw_errors: true |
| 124 | + overridden_fields: true |
| 125 | + package_names: true |
| 126 | + package_prefixed_library_names: true |
| 127 | + parameter_assignments: true |
| 128 | + prefer_asserts_in_initializer_lists: true |
| 129 | + prefer_asserts_with_message: true |
| 130 | + prefer_const_constructors: true |
| 131 | + prefer_const_constructors_in_immutables: true |
| 132 | + prefer_const_declarations: true |
| 133 | + prefer_const_literals_to_create_immutables: true |
| 134 | + prefer_constructors_over_static_methods: true |
| 135 | + prefer_expression_function_bodies: true |
| 136 | + prefer_final_in_for_each: true |
| 137 | + prefer_foreach: true |
| 138 | + prefer_if_elements_to_conditional_expressions: true |
| 139 | + prefer_inlined_adds: true |
| 140 | + prefer_int_literals: true |
| 141 | + prefer_is_not_operator: true |
| 142 | + prefer_null_aware_operators: true |
| 143 | + prefer_typing_uninitialized_variables: true |
| 144 | + prefer_void_to_null: true |
| 145 | + provide_deprecation_message: true |
| 146 | + sized_box_for_whitespace: true |
| 147 | + sort_child_properties_last: true |
| 148 | + test_types_in_equals: true |
| 149 | + throw_in_finally: true |
| 150 | + unnecessary_null_aware_assignments: true |
| 151 | + unnecessary_overrides: true |
| 152 | + unnecessary_parenthesis: true |
| 153 | + unnecessary_raw_strings: true |
| 154 | + unnecessary_statements: true |
| 155 | + unnecessary_string_escapes: true |
| 156 | + unnecessary_string_interpolations: true |
| 157 | + unsafe_html: true |
| 158 | + use_raw_strings: true |
| 159 | + use_string_buffers: true |
| 160 | + valid_regexps: true |
| 161 | + void_checks: true |
| 162 | + |
| 163 | + # Pedantic 1.9.0 |
| 164 | + always_declare_return_types: true |
| 165 | + annotate_overrides: true |
| 166 | + avoid_empty_else: true |
| 167 | + avoid_init_to_null: true |
| 168 | + avoid_null_checks_in_equality_operators: true |
| 169 | + avoid_return_types_on_setters: true |
| 170 | + avoid_shadowing_type_parameters: true |
| 171 | + avoid_types_as_parameter_names: true |
| 172 | + camel_case_extensions: true |
| 173 | + empty_catches: true |
| 174 | + empty_constructor_bodies: true |
| 175 | + library_names: true |
| 176 | + library_prefixes: true |
| 177 | + no_duplicate_case_values: true |
| 178 | + null_closures: true |
| 179 | + omit_local_variable_types: true |
| 180 | + prefer_adjacent_string_concatenation: true |
| 181 | + prefer_collection_literals: true |
| 182 | + prefer_conditional_assignment: true |
| 183 | + prefer_contains: true |
| 184 | + prefer_final_fields: true |
| 185 | + prefer_for_elements_to_map_fromIterable: true |
| 186 | + prefer_generic_function_type_aliases: true |
| 187 | + prefer_if_null_operators: true |
| 188 | + prefer_is_empty: true |
| 189 | + prefer_is_not_empty: true |
| 190 | + prefer_iterable_whereType: true |
| 191 | + prefer_single_quotes: true |
| 192 | + prefer_spread_collections: true |
| 193 | + recursive_getters: true |
| 194 | + slash_for_doc_comments: true |
| 195 | + type_init_formals: true |
| 196 | + unawaited_futures: true |
| 197 | + unnecessary_const: true |
| 198 | + unnecessary_new: true |
| 199 | + unnecessary_null_in_if_null_operators: true |
| 200 | + unnecessary_this: true |
| 201 | + unrelated_type_equality_checks: true |
| 202 | + use_function_type_syntax_for_parameters: true |
| 203 | + use_rethrow_when_possible: true |
| 204 | + |
| 205 | + # Effective_dart 1.2.0 |
| 206 | + camel_case_types: true |
| 207 | + file_names: true |
| 208 | + non_constant_identifier_names: true |
| 209 | + constant_identifier_names: true |
| 210 | + directives_ordering: true |
| 211 | + package_api_docs: true |
| 212 | + implementation_imports: true |
| 213 | + prefer_interpolation_to_compose_strings: true |
| 214 | + unnecessary_brace_in_string_interps: true |
| 215 | + avoid_function_literals_in_foreach_calls: true |
| 216 | + prefer_function_declarations_over_variables: true |
| 217 | + unnecessary_lambdas: true |
| 218 | + unnecessary_getters_setters: true |
| 219 | + prefer_initializing_formals: true |
| 220 | + avoid_catches_without_on_clauses: true |
| 221 | + avoid_catching_errors: true |
| 222 | + use_to_and_as_if_applicable: true |
| 223 | + avoid_classes_with_only_static_members: true |
| 224 | + prefer_mixin: true |
| 225 | + use_setters_to_change_properties: true |
| 226 | + avoid_setters_without_getters: true |
| 227 | + avoid_returning_this: true |
| 228 | + type_annotate_public_apis: true |
| 229 | + avoid_types_on_closure_parameters: true |
| 230 | + avoid_private_typedef_functions: true |
| 231 | + avoid_positional_boolean_parameters: true |
| 232 | + hash_and_equals: true |
| 233 | + avoid_equals_and_hash_code_on_mutable_classes: true |
0 commit comments