Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 1 | # Specify analysis options. |
| 2 | # |
Parker Lougheed | c65e908 | 2023-06-28 12:30:15 -0500 | [diff] [blame] | 3 | # For a list of lints, see: https://dart.dev/lints |
| 4 | # For guidelines on configuring static analysis, see: |
| 5 | # https://dart.dev/guides/language/analysis-options |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 6 | # |
| 7 | # There are other similar analysis options files in the flutter repos, |
| 8 | # which should be kept in sync with this file: |
| 9 | # |
| 10 | # - analysis_options.yaml (this file) |
Parker Lougheed | c65e908 | 2023-06-28 12:30:15 -0500 | [diff] [blame] | 11 | # - https://github.com/flutter/engine/blob/main/analysis_options.yaml |
| 12 | # - https://github.com/flutter/packages/blob/main/analysis_options.yaml |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 13 | # |
Michael Goderbauer | cae740b | 2022-04-08 11:15:34 -0700 | [diff] [blame] | 14 | # This file contains the analysis options used for code in the flutter/flutter |
| 15 | # repository. |
krisgiesing | 07b5f83 | 2016-05-04 10:15:15 -0700 | [diff] [blame] | 16 | |
| 17 | analyzer: |
Sam Rawlins | 2cdef81 | 2022-01-20 15:45:09 -0800 | [diff] [blame] | 18 | language: |
Michael Goderbauer | cae740b | 2022-04-08 11:15:34 -0700 | [diff] [blame] | 19 | strict-casts: true |
Michael Goderbauer | b0a90ae | 2023-09-20 12:59:08 -0700 | [diff] [blame] | 20 | strict-inference: true |
Sam Rawlins | 2cdef81 | 2022-01-20 15:45:09 -0800 | [diff] [blame] | 21 | strict-raw-types: true |
krisgiesing | 07b5f83 | 2016-05-04 10:15:15 -0700 | [diff] [blame] | 22 | errors: |
Christopher Fujino | 5cfb16b | 2020-06-19 12:03:38 -0700 | [diff] [blame] | 23 | # allow self-reference to deprecated members (we do this because otherwise we have |
| 24 | # to annotate every member in every test, assert, etc, when we deprecate something) |
| 25 | deprecated_member_use_from_same_package: ignore |
Devon Carew | 207451f | 2016-08-18 19:11:39 -0700 | [diff] [blame] | 26 | exclude: |
Alexandre Ardhuin | 919dcf5 | 2019-06-27 21:23:16 +0200 | [diff] [blame] | 27 | - "bin/cache/**" |
Christopher Fujino | 4a7f280 | 2021-04-19 15:04:04 -0700 | [diff] [blame] | 28 | # Ignore protoc generated files |
Christopher Fujino | 62d00c6 | 2021-05-25 16:12:53 -0700 | [diff] [blame] | 29 | - "dev/conductor/lib/proto/*" |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 30 | |
| 31 | linter: |
| 32 | rules: |
Michael Goderbauer | cae740b | 2022-04-08 11:15:34 -0700 | [diff] [blame] | 33 | # This list is derived from the list of all available lints located at |
Parker Lougheed | c65e908 | 2023-06-28 12:30:15 -0500 | [diff] [blame] | 34 | # https://github.com/dart-lang/linter/blob/main/example/all.yaml |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 35 | - always_declare_return_types |
| 36 | - always_put_control_body_on_new_line |
| 37 | # - always_put_required_named_parameters_first # we prefer having parameters in the same order as fields https://github.com/flutter/flutter/issues/10219 |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 38 | - always_specify_types |
Alexandre Ardhuin | 73301a3 | 2020-10-16 00:37:04 +0200 | [diff] [blame] | 39 | # - always_use_package_imports # we do this commonly |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 40 | - annotate_overrides |
| 41 | # - avoid_annotating_with_dynamic # conflicts with always_specify_types |
Alexandre Ardhuin | fecf99f | 2019-06-25 17:40:05 +0200 | [diff] [blame] | 42 | - avoid_bool_literals_in_conditional_expressions |
Ian Hickson | 299d484 | 2021-10-14 22:03:03 -0700 | [diff] [blame] | 43 | # - avoid_catches_without_on_clauses # blocked on https://github.com/dart-lang/linter/issues/3023 |
| 44 | # - avoid_catching_errors # blocked on https://github.com/dart-lang/linter/issues/3023 |
Michael Goderbauer | 42d9a2b | 2023-05-11 15:27:51 +0200 | [diff] [blame] | 45 | # - avoid_classes_with_only_static_members # we do this commonly for `abstract final class`es |
Ian Hickson | 299d484 | 2021-10-14 22:03:03 -0700 | [diff] [blame] | 46 | - avoid_double_and_int_checks |
Greg Spencer | 88f3811 | 2021-06-14 14:16:57 -0700 | [diff] [blame] | 47 | - avoid_dynamic_calls |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 48 | - avoid_empty_else |
Alexandre Ardhuin | f5a9902 | 2020-04-06 22:36:01 +0200 | [diff] [blame] | 49 | - avoid_equals_and_hash_code_on_mutable_classes |
Hattomo (TomohiroHattori) | 08a70e7 | 2021-05-20 01:54:02 +0900 | [diff] [blame] | 50 | - avoid_escaping_inner_quotes |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 51 | - avoid_field_initializers_in_const_classes |
Michael Goderbauer | 2a529bc | 2022-01-07 13:50:18 -0800 | [diff] [blame] | 52 | # - avoid_final_parameters # incompatible with prefer_final_parameters |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 53 | - avoid_function_literals_in_foreach_calls |
Ian Hickson | 33e9fd8 | 2023-07-26 16:48:08 -0700 | [diff] [blame] | 54 | # - avoid_implementing_value_types # see https://github.com/dart-lang/linter/issues/4558 |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 55 | - avoid_init_to_null |
Ian Hickson | 299d484 | 2021-10-14 22:03:03 -0700 | [diff] [blame] | 56 | - avoid_js_rounded_ints |
Ian Hickson | bb5cbdc | 2021-10-12 11:28:02 -0700 | [diff] [blame] | 57 | # - avoid_multiple_declarations_per_line # seems to be a stylistic choice we don't subscribe to |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 58 | - avoid_null_checks_in_equality_operators |
Ian Hickson | f25b833 | 2021-10-07 16:48:04 -0700 | [diff] [blame] | 59 | # - avoid_positional_boolean_parameters # would have been nice to enable this but by now there's too many places that break it |
| 60 | - avoid_print |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 61 | # - avoid_private_typedef_functions # we prefer having typedef (discussion in https://github.com/flutter/flutter/pull/16356) |
Ian Hickson | 61a0add | 2021-10-08 09:25:14 -0700 | [diff] [blame] | 62 | - avoid_redundant_argument_values |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 63 | - avoid_relative_lib_imports |
| 64 | - avoid_renaming_method_parameters |
| 65 | - avoid_return_types_on_setters |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 66 | - avoid_returning_null_for_void |
Ian Hickson | 299d484 | 2021-10-14 22:03:03 -0700 | [diff] [blame] | 67 | # - avoid_returning_this # there are enough valid reasons to return `this` that this lint ends up with too many false positives |
Ian Hickson | 989f864 | 2021-10-01 00:58:05 -0700 | [diff] [blame] | 68 | - avoid_setters_without_getters |
Ian Hickson | 6cff338 | 2020-11-16 11:07:37 -0800 | [diff] [blame] | 69 | - avoid_shadowing_type_parameters |
Alexandre Ardhuin | c2ae654 | 2020-03-05 08:03:26 +0100 | [diff] [blame] | 70 | - avoid_single_cascade_in_expression_statements |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 71 | - avoid_slow_async_io |
Michael Goderbauer | 3594d1a | 2021-03-01 15:50:04 -0800 | [diff] [blame] | 72 | - avoid_type_to_string |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 73 | - avoid_types_as_parameter_names |
| 74 | # - avoid_types_on_closure_parameters # conflicts with always_specify_types |
Michael Goderbauer | ed755fb | 2021-03-04 15:29:03 -0800 | [diff] [blame] | 75 | - avoid_unnecessary_containers |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 76 | - avoid_unused_constructor_parameters |
| 77 | - avoid_void_async |
Ian Hickson | b3f63d3 | 2021-10-09 04:03:03 -0700 | [diff] [blame] | 78 | # - avoid_web_libraries_in_flutter # we use web libraries in web-specific code, and our tests prevent us from using them elsewhere |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 79 | - await_only_futures |
Alexandre Ardhuin | 4adad2c | 2019-12-23 18:40:56 +0100 | [diff] [blame] | 80 | - camel_case_extensions |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 81 | - camel_case_types |
| 82 | - cancel_subscriptions |
Ian Hickson | b3f63d3 | 2021-10-09 04:03:03 -0700 | [diff] [blame] | 83 | # - cascade_invocations # doesn't match the typical style of this repo |
Alexandre Ardhuin | 4acc790 | 2020-10-08 21:05:43 +0200 | [diff] [blame] | 84 | - cast_nullable_to_non_nullable |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 85 | # - close_sinks # not reliable enough |
Michael Goderbauer | fdd2d7d | 2022-12-20 14:15:39 -0800 | [diff] [blame] | 86 | - collection_methods_unrelated_type |
Alexandre Ardhuin | ccd3363 | 2022-07-19 00:04:07 +0200 | [diff] [blame] | 87 | - combinators_ordering |
Michael Goderbauer | 1512af7 | 2021-03-02 08:34:03 -0800 | [diff] [blame] | 88 | # - comment_references # blocked on https://github.com/dart-lang/linter/issues/1142 |
Michael Goderbauer | c7eb5b9 | 2022-08-01 15:59:04 -0700 | [diff] [blame] | 89 | - conditional_uri_does_not_exist |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 90 | # - constant_identifier_names # needs an opt-out https://github.com/dart-lang/linter/issues/204 |
| 91 | - control_flow_in_finally |
Michael Goderbauer | 10a7c9b | 2022-07-28 09:07:49 -0700 | [diff] [blame] | 92 | - curly_braces_in_flow_control_structures |
Michael Goderbauer | b308555 | 2022-12-20 16:03:21 -0800 | [diff] [blame] | 93 | - dangling_library_doc_comments |
Ian Hickson | bb5cbdc | 2021-10-12 11:28:02 -0700 | [diff] [blame] | 94 | - depend_on_referenced_packages |
Kate Lovett | fd89029 | 2021-03-08 14:49:03 -0600 | [diff] [blame] | 95 | - deprecated_consistency |
Michael Goderbauer | 42d9a2b | 2023-05-11 15:27:51 +0200 | [diff] [blame] | 96 | # - deprecated_member_use_from_same_package # we allow self-references to deprecated members |
Ian Hickson | b3f63d3 | 2021-10-09 04:03:03 -0700 | [diff] [blame] | 97 | # - diagnostic_describe_all_properties # enabled only at the framework level (packages/flutter/lib) |
Phil Quitslund | 44157cf | 2021-04-30 17:29:04 -0700 | [diff] [blame] | 98 | - directives_ordering |
Michael Goderbauer | fa3777b | 2022-12-20 11:07:15 -0800 | [diff] [blame] | 99 | # - discarded_futures # too many false positives, similar to unawaited_futures |
Ian Hickson | b3f63d3 | 2021-10-09 04:03:03 -0700 | [diff] [blame] | 100 | # - do_not_use_environment # there are appropriate times to use the environment, especially in our tests and build logic |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 101 | - empty_catches |
| 102 | - empty_constructor_bodies |
| 103 | - empty_statements |
Ian Hickson | 66dd2ad | 2021-10-12 11:33:04 -0700 | [diff] [blame] | 104 | - eol_at_end_of_file |
Alexandre Ardhuin | 73301a3 | 2020-10-16 00:37:04 +0200 | [diff] [blame] | 105 | - exhaustive_cases |
Michael Goderbauer | 7e017d3 | 2021-03-02 15:24:04 -0800 | [diff] [blame] | 106 | - file_names |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 107 | - flutter_style_todos |
| 108 | - hash_and_equals |
| 109 | - implementation_imports |
Michael Goderbauer | fdd2d7d | 2022-12-20 14:15:39 -0800 | [diff] [blame] | 110 | - implicit_call_tearoffs |
Michael Goderbauer | 42d9a2b | 2023-05-11 15:27:51 +0200 | [diff] [blame] | 111 | - implicit_reopen |
Michael Goderbauer | cf9ba6c3 | 2023-03-09 12:54:41 -0800 | [diff] [blame] | 112 | - invalid_case_patterns |
Ian Hickson | 6cff338 | 2020-11-16 11:07:37 -0800 | [diff] [blame] | 113 | # - join_return_with_assignment # not required by flutter style |
Alexandre Ardhuin | 73301a3 | 2020-10-16 00:37:04 +0200 | [diff] [blame] | 114 | - leading_newlines_in_multiline_strings |
Michael Goderbauer | b308555 | 2022-12-20 16:03:21 -0800 | [diff] [blame] | 115 | - library_annotations |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 116 | - library_names |
| 117 | - library_prefixes |
Michael Goderbauer | b8a2456 | 2021-05-10 16:26:16 -0700 | [diff] [blame] | 118 | - library_private_types_in_public_api |
Ian Hickson | 6cff338 | 2020-11-16 11:07:37 -0800 | [diff] [blame] | 119 | # - lines_longer_than_80_chars # not required by flutter style |
Michael Goderbauer | 382ceb5 | 2023-08-23 14:35:54 -0700 | [diff] [blame] | 120 | - literal_only_boolean_expressions |
Michael Goderbauer | 42d9a2b | 2023-05-11 15:27:51 +0200 | [diff] [blame] | 121 | # - matching_super_parameters # blocked on https://github.com/dart-lang/language/issues/2509 |
Michael Goderbauer | fc99e7c | 2021-03-01 18:30:17 -0800 | [diff] [blame] | 122 | - missing_whitespace_between_adjacent_strings |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 123 | - no_adjacent_strings_in_list |
Ian Hickson | 7b01346 | 2021-10-11 10:23:04 -0700 | [diff] [blame] | 124 | - no_default_cases |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 125 | - no_duplicate_case_values |
Michael Goderbauer | 5ac9714 | 2022-01-11 17:35:13 -0800 | [diff] [blame] | 126 | - no_leading_underscores_for_library_prefixes |
Michael Goderbauer | 5684b9f | 2022-01-21 14:43:59 -0800 | [diff] [blame] | 127 | - no_leading_underscores_for_local_identifiers |
Michael Goderbauer | 5e1ba70 | 2023-05-16 18:14:23 +0200 | [diff] [blame] | 128 | - no_literal_bool_comparisons |
Ian Hickson | 6cff338 | 2020-11-16 11:07:37 -0800 | [diff] [blame] | 129 | - no_logic_in_create_state |
| 130 | # - no_runtimeType_toString # ok in tests; we enable this only in packages/ |
Michael Goderbauer | 60a87d0 | 2023-06-01 21:27:17 -0700 | [diff] [blame] | 131 | - no_self_assignments |
Michael Goderbauer | aa5f4a2 | 2023-06-30 18:16:21 -0700 | [diff] [blame] | 132 | - no_wildcard_variable_uses |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 133 | - non_constant_identifier_names |
Ian Hickson | bb5cbdc | 2021-10-12 11:28:02 -0700 | [diff] [blame] | 134 | - noop_primitive_operations |
Alexandre Ardhuin | d2858f0 | 2020-10-08 09:39:13 +0200 | [diff] [blame] | 135 | - null_check_on_nullable_type_parameter |
Michael Goderbauer | ea8e616 | 2021-03-02 15:25:31 -0800 | [diff] [blame] | 136 | - null_closures |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 137 | # - omit_local_variable_types # opposite of always_specify_types |
| 138 | # - one_member_abstracts # too many false positives |
Ian Hickson | 9421627 | 2021-10-11 14:13:03 -0700 | [diff] [blame] | 139 | - only_throw_errors # this does get disabled in a few places where we have legacy code that uses strings et al |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 140 | - overridden_fields |
| 141 | - package_api_docs |
Michael Goderbauer | 7e017d3 | 2021-03-02 15:24:04 -0800 | [diff] [blame] | 142 | - package_names |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 143 | - package_prefixed_library_names |
| 144 | # - parameter_assignments # we do this commonly |
| 145 | - prefer_adjacent_string_concatenation |
| 146 | - prefer_asserts_in_initializer_lists |
Ian Hickson | 6cff338 | 2020-11-16 11:07:37 -0800 | [diff] [blame] | 147 | # - prefer_asserts_with_message # not required by flutter style |
Phil Quitslund | 802eca2 | 2019-03-06 11:05:16 -0800 | [diff] [blame] | 148 | - prefer_collection_literals |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 149 | - prefer_conditional_assignment |
Dan Field | fe9512f | 2019-04-29 16:02:42 -0700 | [diff] [blame] | 150 | - prefer_const_constructors |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 151 | - prefer_const_constructors_in_immutables |
| 152 | - prefer_const_declarations |
| 153 | - prefer_const_literals_to_create_immutables |
Ian Hickson | 6cff338 | 2020-11-16 11:07:37 -0800 | [diff] [blame] | 154 | # - prefer_constructors_over_static_methods # far too many false positives |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 155 | - prefer_contains |
Alexandre Ardhuin | 9a3a749 | 2019-06-25 15:59:15 +0200 | [diff] [blame] | 156 | # - prefer_double_quotes # opposite of prefer_single_quotes |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 157 | # - prefer_expression_function_bodies # conflicts with https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#consider-using--for-short-functions-and-methods |
| 158 | - prefer_final_fields |
Alexandre Ardhuin | 4f9b6cf | 2020-01-07 16:32:04 +0100 | [diff] [blame] | 159 | - prefer_final_in_for_each |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 160 | - prefer_final_locals |
Michael Goderbauer | f6b9c4d | 2023-04-26 09:36:19 +0200 | [diff] [blame] | 161 | # - prefer_final_parameters # adds too much verbosity |
Alexandre Ardhuin | a541934 | 2020-01-08 17:03:02 +0100 | [diff] [blame] | 162 | - prefer_for_elements_to_map_fromIterable |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 163 | - prefer_foreach |
Michael Goderbauer | 807bb29 | 2021-03-05 18:29:04 -0800 | [diff] [blame] | 164 | - prefer_function_declarations_over_variables |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 165 | - prefer_generic_function_type_aliases |
Alexandre Ardhuin | df4bf45 | 2019-09-17 16:23:44 +0200 | [diff] [blame] | 166 | - prefer_if_elements_to_conditional_expressions |
Alexandre Ardhuin | b041a58 | 2019-07-09 10:53:35 +0200 | [diff] [blame] | 167 | - prefer_if_null_operators |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 168 | - prefer_initializing_formals |
Alexandre Ardhuin | 919dcf5 | 2019-06-27 21:23:16 +0200 | [diff] [blame] | 169 | - prefer_inlined_adds |
Michael Goderbauer | 0f56829 | 2021-03-02 10:14:02 -0800 | [diff] [blame] | 170 | # - prefer_int_literals # conflicts with https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#use-double-literals-for-double-constants |
Alexandre Ardhuin | 34059ee | 2021-06-01 20:14:06 +0200 | [diff] [blame] | 171 | - prefer_interpolation_to_compose_strings |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 172 | - prefer_is_empty |
Alexandre Ardhuin | c0125cb | 2019-05-20 17:00:45 +0200 | [diff] [blame] | 173 | - prefer_is_not_empty |
Alexandre Ardhuin | 4adad2c | 2019-12-23 18:40:56 +0100 | [diff] [blame] | 174 | - prefer_is_not_operator |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 175 | - prefer_iterable_whereType |
Michael Goderbauer | 06ed8e6 | 2023-03-21 16:12:26 -0700 | [diff] [blame] | 176 | - prefer_mixin |
Ian Hickson | 66dd2ad | 2021-10-12 11:33:04 -0700 | [diff] [blame] | 177 | # - prefer_null_aware_method_calls # "call()" is confusing to people new to the language since it's not documented anywhere |
Michael Goderbauer | 2a529bc | 2022-01-07 13:50:18 -0800 | [diff] [blame] | 178 | - prefer_null_aware_operators |
Ian Hickson | f90b019 | 2021-10-11 10:28:07 -0700 | [diff] [blame] | 179 | - prefer_relative_imports |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 180 | - prefer_single_quotes |
Alexandre Ardhuin | 919dcf5 | 2019-06-27 21:23:16 +0200 | [diff] [blame] | 181 | - prefer_spread_collections |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 182 | - prefer_typing_uninitialized_variables |
| 183 | - prefer_void_to_null |
Michael Goderbauer | d320937 | 2021-03-02 16:34:05 -0800 | [diff] [blame] | 184 | - provide_deprecation_message |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 185 | # - public_member_api_docs # enabled on a case-by-case basis; see e.g. packages/analysis_options.yaml |
| 186 | - recursive_getters |
Michael Goderbauer | fa3777b | 2022-12-20 11:07:15 -0800 | [diff] [blame] | 187 | # - require_trailing_commas # would be nice, but requires a lot of manual work: 10,000+ code locations would need to be reformatted by hand after bulk fix is applied |
Michael Goderbauer | 2a529bc | 2022-01-07 13:50:18 -0800 | [diff] [blame] | 188 | - secure_pubspec_urls |
Greg Spencer | c6ef4c7 | 2021-03-04 01:29:02 +0000 | [diff] [blame] | 189 | - sized_box_for_whitespace |
Michael Goderbauer | fa3777b | 2022-12-20 11:07:15 -0800 | [diff] [blame] | 190 | - sized_box_shrink_expand |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 191 | - slash_for_doc_comments |
Ian Hickson | 6d5fc42 | 2021-10-11 21:23:02 -0700 | [diff] [blame] | 192 | - sort_child_properties_last |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 193 | - sort_constructors_first |
Phil Quitslund | 1fef591 | 2020-09-23 21:37:08 -0700 | [diff] [blame] | 194 | # - sort_pub_dependencies # prevents separating pinned transitive dependencies |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 195 | - sort_unnamed_constructors_first |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 196 | - test_types_in_equals |
| 197 | - throw_in_finally |
Alexandre Ardhuin | d2858f0 | 2020-10-08 09:39:13 +0200 | [diff] [blame] | 198 | - tighten_type_of_initializing_formals |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 199 | # - type_annotate_public_apis # subset of always_specify_types |
| 200 | - type_init_formals |
Michael Goderbauer | 42d9a2b | 2023-05-11 15:27:51 +0200 | [diff] [blame] | 201 | - type_literal_in_constant_pattern |
Ian Hickson | 299d484 | 2021-10-14 22:03:03 -0700 | [diff] [blame] | 202 | # - unawaited_futures # too many false positives, especially with the way AnimationController works |
Michael Goderbauer | cb867bb | 2021-03-05 18:38:15 -0800 | [diff] [blame] | 203 | - unnecessary_await_in_return |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 204 | - unnecessary_brace_in_string_interps |
Michael Goderbauer | fda9ecf | 2023-03-22 14:12:22 -0700 | [diff] [blame] | 205 | - unnecessary_breaks |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 206 | - unnecessary_const |
Ian Hickson | 66dd2ad | 2021-10-12 11:33:04 -0700 | [diff] [blame] | 207 | - unnecessary_constructor_name |
Alexandre Ardhuin | 4adad2c | 2019-12-23 18:40:56 +0100 | [diff] [blame] | 208 | # - unnecessary_final # conflicts with prefer_final_locals |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 209 | - unnecessary_getters_setters |
| 210 | # - unnecessary_lambdas # has false positives: https://github.com/dart-lang/linter/issues/498 |
Michael Goderbauer | 40a2689 | 2022-01-12 21:10:19 -0800 | [diff] [blame] | 211 | - unnecessary_late |
Michael Goderbauer | fdd2d7d | 2022-12-20 14:15:39 -0800 | [diff] [blame] | 212 | - unnecessary_library_directive |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 213 | - unnecessary_new |
| 214 | - unnecessary_null_aware_assignments |
Alexandre Ardhuin | ccd3363 | 2022-07-19 00:04:07 +0200 | [diff] [blame] | 215 | - unnecessary_null_aware_operator_on_extension_on_nullable |
Abhishek Ghaskata | b554f89 | 2021-05-14 23:14:03 +0530 | [diff] [blame] | 216 | - unnecessary_null_checks |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 217 | - unnecessary_null_in_if_null_operators |
Alexandre Ardhuin | 71c1f6c | 2020-09-23 06:39:47 +0200 | [diff] [blame] | 218 | - unnecessary_nullable_for_final_variable_declarations |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 219 | - unnecessary_overrides |
| 220 | - unnecessary_parenthesis |
Ian Hickson | 299d484 | 2021-10-14 22:03:03 -0700 | [diff] [blame] | 221 | # - unnecessary_raw_strings # what's "necessary" is a matter of opinion; consistency across strings can help readability more than this lint |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 222 | - unnecessary_statements |
Alexandre Ardhuin | 17cdf55 | 2020-10-26 20:42:05 +0100 | [diff] [blame] | 223 | - unnecessary_string_escapes |
Alexandre Ardhuin | 0bd45bc | 2020-02-14 09:43:52 +0100 | [diff] [blame] | 224 | - unnecessary_string_interpolations |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 225 | - unnecessary_this |
Alexandre Ardhuin | ccd3363 | 2022-07-19 00:04:07 +0200 | [diff] [blame] | 226 | - unnecessary_to_list_in_spreads |
Michael Goderbauer | 55b6f04 | 2023-07-05 17:09:01 -0700 | [diff] [blame] | 227 | - unreachable_from_main |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 228 | - unrelated_type_equality_checks |
Ian Hickson | 299d484 | 2021-10-14 22:03:03 -0700 | [diff] [blame] | 229 | - unsafe_html |
Ian Hickson | 66dd2ad | 2021-10-12 11:33:04 -0700 | [diff] [blame] | 230 | - use_build_context_synchronously |
Michael Goderbauer | 81bc54b | 2022-12-20 14:09:55 -0800 | [diff] [blame] | 231 | - use_colored_box |
Michael Goderbauer | fa3777b | 2022-12-20 11:07:15 -0800 | [diff] [blame] | 232 | # - use_decorated_box # leads to bugs: DecoratedBox and Container are not equivalent (Container inserts extra padding) |
Michael Goderbauer | 0220afd | 2022-12-20 12:06:24 -0800 | [diff] [blame] | 233 | - use_enums |
Alexandre Ardhuin | b5ce061 | 2019-06-25 17:58:19 +0200 | [diff] [blame] | 234 | - use_full_hex_values_for_flutter_colors |
Michael Goderbauer | 7b251f5 | 2021-03-04 08:59:17 -0800 | [diff] [blame] | 235 | - use_function_type_syntax_for_parameters |
Tomasz Gucio | e4351ff | 2022-02-22 23:39:20 +0100 | [diff] [blame] | 236 | - use_if_null_to_convert_nulls_to_bools |
Alexandre Ardhuin | c0176c9 | 2020-10-16 20:20:00 +0200 | [diff] [blame] | 237 | - use_is_even_rather_than_modulo |
Michael Goderbauer | 0f56829 | 2021-03-02 10:14:02 -0800 | [diff] [blame] | 238 | - use_key_in_widget_constructors |
Ian Hickson | 8a6a76a | 2020-08-27 16:38:10 -0700 | [diff] [blame] | 239 | - use_late_for_private_fields_and_variables |
Abhishek Ghaskata | 254c9f1 | 2021-05-14 01:59:06 +0530 | [diff] [blame] | 240 | - use_named_constants |
Alexandre Ardhuin | 17cdf55 | 2020-10-26 20:42:05 +0100 | [diff] [blame] | 241 | - use_raw_strings |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 242 | - use_rethrow_when_possible |
Ian Hickson | 299d484 | 2021-10-14 22:03:03 -0700 | [diff] [blame] | 243 | - use_setters_to_change_properties |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 244 | # - use_string_buffers # has false positives: https://github.com/dart-lang/sdk/issues/34182 |
Michael Goderbauer | fdd2d7d | 2022-12-20 14:15:39 -0800 | [diff] [blame] | 245 | - use_string_in_part_of_directives |
Michael Goderbauer | cc4cc69 | 2022-04-14 13:26:18 -0700 | [diff] [blame] | 246 | - use_super_parameters |
Alexandre Ardhuin | cfc0859 | 2021-06-04 07:14:03 +0200 | [diff] [blame] | 247 | - use_test_throws_matchers |
Dan Field | 8af3e48 | 2019-01-11 13:38:02 -0800 | [diff] [blame] | 248 | # - use_to_and_as_if_applicable # has false positives, so we prefer to catch this by code-review |
| 249 | - valid_regexps |
Ian Hickson | e2b169e | 2020-01-13 10:03:01 -0800 | [diff] [blame] | 250 | - void_checks |