|
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 | 2 |
|
| 3 | +analyzer: |
| 4 | + exclude: |
| 5 | + - "**/*.g.dart" |
| 6 | + - "**/*.freezed.dart" |
| 7 | + errors: |
| 8 | + invalid_annotation_target: ignore |
| 9 | + |
12 | 10 | linter: |
13 | | - # The lint rules applied to this project can be customized in the |
14 | | - # section below to disable rules from the `package:flutter_lints/flutter.yaml` |
15 | | - # included above or to enable additional rules. A list of all available lints |
16 | | - # and their documentation is published at |
17 | | - # https://dart-lang.github.io/linter/lints/index.html. |
18 | | - # |
19 | | - # Instead of disabling a lint rule for the entire project in the |
20 | | - # section below, it can also be suppressed for a single line of code |
21 | | - # or a specific dart file by using the `// ignore: name_of_lint` and |
22 | | - # `// ignore_for_file: name_of_lint` syntax on the line or in the file |
23 | | - # producing the lint. |
24 | 11 | rules: |
25 | | - # avoid_print: false # Uncomment to disable the `avoid_print` rule |
26 | | - # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule |
27 | | - |
28 | | -# Additional information about this file can be found at |
29 | | -# https://dart.dev/guides/language/analysis-options |
| 12 | + always_declare_return_types: true |
| 13 | + always_put_required_named_parameters_first: true |
| 14 | + always_require_non_null_named_parameters: true |
| 15 | + annotate_overrides: true |
| 16 | + avoid_annotating_with_dynamic: true |
| 17 | + avoid_bool_literals_in_conditional_expressions: true |
| 18 | + avoid_catches_without_on_clauses: true |
| 19 | + avoid_catching_errors: true |
| 20 | + avoid_double_and_int_checks: true |
| 21 | + avoid_empty_else: true |
| 22 | + avoid_equals_and_hash_code_on_mutable_classes: true |
| 23 | + avoid_escaping_inner_quotes: true |
| 24 | + avoid_field_initializers_in_const_classes: true |
| 25 | + avoid_function_literals_in_foreach_calls: true |
| 26 | + avoid_implementing_value_types: true |
| 27 | + avoid_init_to_null: true |
| 28 | + avoid_null_checks_in_equality_operators: true |
| 29 | + avoid_print: true |
| 30 | + avoid_private_typedef_functions: true |
| 31 | + avoid_redundant_argument_values: true |
| 32 | + avoid_relative_lib_imports: true |
| 33 | + avoid_renaming_method_parameters: true |
| 34 | + avoid_return_types_on_setters: true |
| 35 | + avoid_returning_null: true |
| 36 | + avoid_returning_null_for_future: true |
| 37 | + avoid_returning_null_for_void: true |
| 38 | + avoid_returning_this: true |
| 39 | + avoid_setters_without_getters: true |
| 40 | + avoid_shadowing_type_parameters: true |
| 41 | + avoid_single_cascade_in_expression_statements: true |
| 42 | + avoid_slow_async_io: true |
| 43 | + avoid_type_to_string: true |
| 44 | + avoid_types_as_parameter_names: true |
| 45 | + avoid_unnecessary_containers: true |
| 46 | + avoid_unused_constructor_parameters: true |
| 47 | + avoid_web_libraries_in_flutter: true |
| 48 | + await_only_futures: true |
| 49 | + camel_case_extensions: true |
| 50 | + camel_case_types: true |
| 51 | + cascade_invocations: true |
| 52 | + constant_identifier_names: true |
| 53 | + control_flow_in_finally: true |
| 54 | + close_sinks: true |
| 55 | + curly_braces_in_flow_control_structures: true |
| 56 | + deprecated_consistency: true |
| 57 | + directives_ordering: true |
| 58 | + empty_catches: true |
| 59 | + empty_constructor_bodies: true |
| 60 | + empty_statements: true |
| 61 | + eol_at_end_of_file: true |
| 62 | + exhaustive_cases: true |
| 63 | + file_names: true |
| 64 | + flutter_style_todos: true |
| 65 | + hash_and_equals: true |
| 66 | + implementation_imports: true |
| 67 | + invariant_booleans: true |
| 68 | + iterable_contains_unrelated_type: true |
| 69 | + join_return_with_assignment: true |
| 70 | + leading_newlines_in_multiline_strings: true |
| 71 | + library_names: true |
| 72 | + library_prefixes: true |
| 73 | + list_remove_unrelated_type: true |
| 74 | + literal_only_boolean_expressions: true |
| 75 | + missing_whitespace_between_adjacent_strings: true |
| 76 | + no_adjacent_strings_in_list: true |
| 77 | + no_duplicate_case_values: true |
| 78 | + no_logic_in_create_state: true |
| 79 | + no_runtimeType_toString: true |
| 80 | + non_constant_identifier_names: true |
| 81 | + noop_primitive_operations: true |
| 82 | + null_check_on_nullable_type_parameter: true |
| 83 | + null_closures: true |
| 84 | + omit_local_variable_types: true |
| 85 | + one_member_abstracts: true |
| 86 | + only_throw_errors: true |
| 87 | + overridden_fields: true |
| 88 | + package_api_docs: true |
| 89 | + package_names: true |
| 90 | + package_prefixed_library_names: true |
| 91 | + parameter_assignments: true |
| 92 | + prefer_adjacent_string_concatenation: true |
| 93 | + prefer_asserts_in_initializer_lists: true |
| 94 | + prefer_asserts_with_message: true |
| 95 | + prefer_collection_literals: true |
| 96 | + prefer_conditional_assignment: true |
| 97 | + prefer_const_constructors: true |
| 98 | + prefer_const_constructors_in_immutables: true |
| 99 | + prefer_const_declarations: true |
| 100 | + prefer_const_literals_to_create_immutables: true |
| 101 | + prefer_constructors_over_static_methods: true |
| 102 | + prefer_contains: true |
| 103 | + prefer_equal_for_default_values: true |
| 104 | + prefer_final_fields: true |
| 105 | + prefer_final_in_for_each: true |
| 106 | + prefer_final_locals: true |
| 107 | + prefer_for_elements_to_map_fromIterable: true |
| 108 | + prefer_foreach: true |
| 109 | + prefer_function_declarations_over_variables: true |
| 110 | + prefer_generic_function_type_aliases: true |
| 111 | + prefer_if_elements_to_conditional_expressions: true |
| 112 | + prefer_if_null_operators: true |
| 113 | + prefer_initializing_formals: true |
| 114 | + prefer_inlined_adds: true |
| 115 | + prefer_int_literals: true |
| 116 | + prefer_interpolation_to_compose_strings: true |
| 117 | + prefer_is_empty: true |
| 118 | + prefer_is_not_empty: true |
| 119 | + prefer_is_not_operator: true |
| 120 | + prefer_iterable_whereType: true |
| 121 | + prefer_mixin: true |
| 122 | + prefer_null_aware_method_calls: true |
| 123 | + prefer_null_aware_operators: true |
| 124 | + prefer_relative_imports: true |
| 125 | + prefer_single_quotes: true |
| 126 | + prefer_spread_collections: true |
| 127 | + prefer_typing_uninitialized_variables: true |
| 128 | + prefer_void_to_null: true |
| 129 | + provide_deprecation_message: true |
| 130 | + recursive_getters: true |
| 131 | + sized_box_for_whitespace: true |
| 132 | + slash_for_doc_comments: true |
| 133 | + sort_child_properties_last: true |
| 134 | + sort_constructors_first: true |
| 135 | + sort_pub_dependencies: true |
| 136 | + sort_unnamed_constructors_first: true |
| 137 | + test_types_in_equals: true |
| 138 | + throw_in_finally: true |
| 139 | + tighten_type_of_initializing_formals: true |
| 140 | + type_annotate_public_apis: true |
| 141 | + type_init_formals: true |
| 142 | + unawaited_futures: false |
| 143 | + unnecessary_await_in_return: true |
| 144 | + unnecessary_brace_in_string_interps: true |
| 145 | + unnecessary_const: true |
| 146 | + unnecessary_constructor_name: true |
| 147 | + unnecessary_getters_setters: true |
| 148 | + unnecessary_lambdas: true |
| 149 | + unnecessary_new: true |
| 150 | + unnecessary_null_aware_assignments: true |
| 151 | + unnecessary_null_checks: true |
| 152 | + unnecessary_null_in_if_null_operators: true |
| 153 | + unnecessary_nullable_for_final_variable_declarations: true |
| 154 | + unnecessary_overrides: true |
| 155 | + unnecessary_parenthesis: true |
| 156 | + unnecessary_raw_strings: true |
| 157 | + unnecessary_statements: true |
| 158 | + unnecessary_string_escapes: true |
| 159 | + unnecessary_string_interpolations: true |
| 160 | + unnecessary_this: true |
| 161 | + unrelated_type_equality_checks: true |
| 162 | + unsafe_html: true |
| 163 | + use_build_context_synchronously: true |
| 164 | + use_full_hex_values_for_flutter_colors: true |
| 165 | + use_function_type_syntax_for_parameters: true |
| 166 | + use_if_null_to_convert_nulls_to_bools: true |
| 167 | + use_is_even_rather_than_modulo: true |
| 168 | + use_key_in_widget_constructors: true |
| 169 | + use_late_for_private_fields_and_variables: true |
| 170 | + use_named_constants: true |
| 171 | + use_raw_strings: true |
| 172 | + use_rethrow_when_possible: true |
| 173 | + valid_regexps: true |
| 174 | + void_checks: true |
0 commit comments