|
| 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 | +include: package:flutter_lints/flutter.yaml |
| 11 | +analyzer: |
| 12 | + exclude: |
| 13 | + - example/ |
| 14 | +linter: |
| 15 | + # The lint rules applied to this project can be customized in the |
| 16 | + # section below to disable rules from the `package:flutter_lints/flutter.yaml` |
| 17 | + # included above or to enable additional rules. A list of all available lints |
| 18 | + # and their documentation is published at |
| 19 | + # https://dart-lang.github.io/linter/lints/index.html. |
| 20 | + # |
| 21 | + # Instead of disabling a lint rule for the entire project in the |
| 22 | + # section below, it can also be suppressed for a single line of code |
| 23 | + # or a specific dart file by using the `// ignore: name_of_lint` and |
| 24 | + # `// ignore_for_file: name_of_lint` syntax on the line or in the file |
| 25 | + # producing the lint. |
| 26 | + rules: |
| 27 | + # Errors |
| 28 | + use_build_context_synchronously: true |
| 29 | + unnecessary_statements: true |
| 30 | + throw_in_finally: true |
| 31 | + test_types_in_equals: true |
| 32 | + no_adjacent_strings_in_list: true |
| 33 | + literal_only_boolean_expressions: true |
| 34 | + invariant_booleans: true |
| 35 | + diagnostic_describe_all_properties: true |
| 36 | + comment_references: false |
| 37 | + close_sinks: true |
| 38 | + cancel_subscriptions: true |
| 39 | + avoid_type_to_string: true |
| 40 | + avoid_slow_async_io: true |
| 41 | + avoid_returning_null_for_future: true |
| 42 | + avoid_dynamic_calls: true |
| 43 | + prefer_relative_imports: true |
| 44 | + # Style |
| 45 | + avoid_void_async: true |
| 46 | + avoid_setters_without_getters: true |
| 47 | + avoid_returning_this: true |
| 48 | + avoid_returning_null: true |
| 49 | + avoid_redundant_argument_values: true |
| 50 | + avoid_private_typedef_functions: true |
| 51 | + avoid_positional_boolean_parameters: true |
| 52 | + avoid_multiple_declarations_per_line: true |
| 53 | + avoid_js_rounded_ints: true |
| 54 | + avoid_implementing_value_types: true |
| 55 | + avoid_field_initializers_in_const_classes: true |
| 56 | + avoid_escaping_inner_quotes: true |
| 57 | + avoid_equals_and_hash_code_on_mutable_classes: true |
| 58 | + avoid_double_and_int_checks: true |
| 59 | + avoid_classes_with_only_static_members: true |
| 60 | + avoid_catching_errors: true |
| 61 | + avoid_catches_without_on_clauses: true |
| 62 | + avoid_bool_literals_in_conditional_expressions: true |
| 63 | + always_put_required_named_parameters_first: true |
| 64 | + always_declare_return_types: true |
| 65 | + avoid_unused_constructor_parameters: true |
| 66 | + avoid_types_on_closure_parameters: true |
| 67 | + cast_nullable_to_non_nullable: true |
| 68 | + cascade_invocations: true |
| 69 | + deprecated_consistency: true |
| 70 | + directives_ordering: true |
| 71 | + flutter_style_todos: true |
| 72 | + join_return_with_assignment: true |
| 73 | + leading_newlines_in_multiline_strings: true |
| 74 | + library_private_types_in_public_api: true |
| 75 | + lines_longer_than_80_chars: true |
| 76 | + missing_whitespace_between_adjacent_strings: true |
| 77 | + no_runtimeType_toString: true |
| 78 | + noop_primitive_operations: true |
| 79 | + null_check_on_nullable_type_parameter: true |
| 80 | + one_member_abstracts: true |
| 81 | + package_api_docs: true |
| 82 | + only_throw_errors: true |
| 83 | + parameter_assignments: true |
| 84 | + prefer_asserts_in_initializer_lists: true |
| 85 | + prefer_asserts_with_message: true |
| 86 | + prefer_constructors_over_static_methods: true |
| 87 | + prefer_single_quotes: true |
| 88 | + prefer_expression_function_bodies: true |
| 89 | + prefer_final_in_for_each: true |
| 90 | + prefer_final_locals: true |
| 91 | + prefer_final_parameters: true |
| 92 | + prefer_if_elements_to_conditional_expressions: true |
| 93 | + prefer_interpolation_to_compose_strings: true |
| 94 | + prefer_mixin: true |
| 95 | + prefer_null_aware_method_calls: true |
| 96 | + public_member_api_docs: true |
| 97 | + require_trailing_commas: true |
| 98 | + sort_child_properties_last: true |
| 99 | + sort_constructors_first: true |
| 100 | + sort_unnamed_constructors_first: true |
| 101 | + tighten_type_of_initializing_formals: true |
| 102 | + type_annotate_public_apis: true |
| 103 | + unawaited_futures: true |
| 104 | + unnecessary_await_in_return: true |
| 105 | + unnecessary_lambdas: true |
| 106 | + unnecessary_null_aware_assignments: true |
| 107 | + unnecessary_null_checks: true |
| 108 | + unnecessary_nullable_for_final_variable_declarations: true |
| 109 | + unnecessary_parenthesis: true |
| 110 | + unnecessary_raw_strings: true |
| 111 | + use_is_even_rather_than_modulo: true |
| 112 | + use_named_constants: true |
| 113 | + use_raw_strings: true |
| 114 | + use_setters_to_change_properties: true |
| 115 | + use_string_buffers: true |
| 116 | + use_test_throws_matchers: true |
| 117 | + use_to_and_as_if_applicable: true |
| 118 | + depend_on_referenced_packages: true |
| 119 | + # avoid_classes_with_only_static_members: false |
| 120 | + # avoid_print: false # Uncomment to disable the `avoid_print` rule |
| 121 | + # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule |
| 122 | +# Additional information about this file can be found at |
| 123 | +# https://dart.dev/guides/language/analysis-options |
0 commit comments