You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: analysis_options.yaml
+33-11Lines changed: 33 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -29,6 +29,9 @@ analyzer:
29
29
missing_return: warning
30
30
# allow having TODOs in the code
31
31
todo: ignore
32
+
# allow self-reference to deprecated members (we do this because otherwise we have
33
+
# to annotate every member in every test, assert, etc, when we deprecate something)
34
+
deprecated_member_use_from_same_package: ignore
32
35
# Ignore analyzer hints for updating pubspecs when using Future or
33
36
# Stream and not importing dart:async
34
37
# Please see https://github.com/flutter/flutter/pull/24528 for details.
@@ -39,6 +42,7 @@ analyzer:
39
42
# see https://github.com/dart-lang/sdk/issues/28463
40
43
- "lib/i18n/messages_*.dart"
41
44
- "lib/src/http/**"
45
+
- "test_fixes/**"
42
46
43
47
linter:
44
48
rules:
@@ -50,6 +54,7 @@ linter:
50
54
# - always_put_required_named_parameters_first # we prefer having parameters in the same order as fields https://github.com/flutter/flutter/issues/10219
51
55
- always_require_non_null_named_parameters
52
56
- always_specify_types
57
+
# - always_use_package_imports # we do this commonly
53
58
- annotate_overrides
54
59
# - avoid_annotating_with_dynamic # conflicts with always_specify_types
55
60
# - avoid_as # required for implicit-casts: true
@@ -60,6 +65,7 @@ linter:
60
65
# - avoid_double_and_int_checks # only useful when targeting JS runtime
61
66
- avoid_empty_else
62
67
- avoid_equals_and_hash_code_on_mutable_classes
68
+
# - avoid_escaping_inner_quotes # not yet tested
63
69
- avoid_field_initializers_in_const_classes
64
70
- avoid_function_literals_in_foreach_calls
65
71
# - avoid_implementing_value_types # not yet tested
@@ -78,9 +84,10 @@ linter:
78
84
- avoid_returning_null_for_void
79
85
# - avoid_returning_this # there are plenty of valid reasons to return this
80
86
# - avoid_setters_without_getters # not yet tested
81
-
#- avoid_shadowing_type_parameters # not yet tested
87
+
- avoid_shadowing_type_parameters
82
88
- avoid_single_cascade_in_expression_statements
83
89
- avoid_slow_async_io
90
+
# - avoid_type_to_string # we do this commonly
84
91
- avoid_types_as_parameter_names
85
92
# - avoid_types_on_closure_parameters # conflicts with always_specify_types
86
93
# - avoid_unnecessary_containers # not yet tested
@@ -92,53 +99,59 @@ linter:
92
99
- camel_case_types
93
100
- cancel_subscriptions
94
101
# - cascade_invocations # not yet tested
102
+
- cast_nullable_to_non_nullable
95
103
# - close_sinks # not reliable enough
96
104
# - comment_references # blocked on https://github.com/flutter/flutter/issues/20765
97
105
# - constant_identifier_names # needs an opt-out https://github.com/dart-lang/linter/issues/204
98
106
- control_flow_in_finally
99
-
# - curly_braces_in_flow_control_structures # not yet tested
107
+
# - curly_braces_in_flow_control_structures # not required by flutter style
100
108
# - diagnostic_describe_all_properties # not yet tested
101
109
- directives_ordering
110
+
# - do_not_use_environment # we do this commonly
102
111
- empty_catches
103
112
- empty_constructor_bodies
104
113
- empty_statements
114
+
- exhaustive_cases
105
115
# - file_names # not yet tested
106
116
- flutter_style_todos
107
117
- hash_and_equals
108
118
- implementation_imports
109
119
# - invariant_booleans # too many false positives: https://github.com/dart-lang/linter/issues/811
110
120
- iterable_contains_unrelated_type
111
-
# - join_return_with_assignment # not yet tested
121
+
# - join_return_with_assignment # not required by flutter style
122
+
- leading_newlines_in_multiline_strings
112
123
- library_names
113
124
- library_prefixes
114
-
# - lines_longer_than_80_chars # not yet tested
125
+
# - lines_longer_than_80_chars # not required by flutter style
115
126
- list_remove_unrelated_type
116
127
# - literal_only_boolean_expressions # too many false positives: https://github.com/dart-lang/sdk/issues/34181
117
128
# - missing_whitespace_between_adjacent_strings # not yet tested
118
129
- no_adjacent_strings_in_list
130
+
# - no_default_cases # too many false positives
119
131
- no_duplicate_case_values
120
-
#- no_logic_in_create_state # not yet tested
121
-
# - no_runtimeType_toString # not yet tested
132
+
- no_logic_in_create_state
133
+
# - no_runtimeType_toString # ok in tests; we enable this only in packages/
122
134
- non_constant_identifier_names
123
-
# - null_closures # not yet tested
135
+
- null_check_on_nullable_type_parameter
136
+
# - null_closures # not required by flutter style
124
137
# - omit_local_variable_types # opposite of always_specify_types
125
138
# - one_member_abstracts # too many false positives
0 commit comments