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
# This file contains the analysis options used by Flutter tools, such as
11
-
# IntelliJ, Android Studio, and the 'flutter analyze' command.
12
-
#
13
10
# This file is derived from the master file in the flutter repo, and should be
14
11
# kept in sync with it.
15
12
@@ -23,8 +20,8 @@ analyzer:
23
20
missing_return: warning
24
21
# allow having TODOs in the code
25
22
todo: ignore
26
-
exclude:
27
-
- 'flutter/**'
23
+
# Turned off until null-safe rollout is complete.
24
+
unnecessary_null_comparison: ignore
28
25
29
26
linter:
30
27
rules:
@@ -36,23 +33,28 @@ linter:
36
33
# - always_put_required_named_parameters_first # we prefer having parameters in the same order as fields https://github.com/flutter/flutter/issues/10219
37
34
- always_require_non_null_named_parameters
38
35
- always_specify_types
36
+
# - always_use_package_imports # we do this commonly
39
37
- annotate_overrides
40
38
# - avoid_annotating_with_dynamic # conflicts with always_specify_types
41
-
# - avoid_as # no longer relevant with null safety
42
39
- avoid_bool_literals_in_conditional_expressions
43
40
# - avoid_catches_without_on_clauses # we do this commonly
44
41
# - avoid_catching_errors # we do this commonly
45
42
- avoid_classes_with_only_static_members
46
43
# - avoid_double_and_int_checks # only useful when targeting JS runtime
44
+
# - avoid_dynamic_calls # not yet tested
47
45
- avoid_empty_else
46
+
- avoid_equals_and_hash_code_on_mutable_classes
47
+
# - avoid_escaping_inner_quotes # not yet tested
48
48
- avoid_field_initializers_in_const_classes
49
49
- avoid_function_literals_in_foreach_calls
50
50
# - avoid_implementing_value_types # not yet tested
51
51
- avoid_init_to_null
52
52
# - avoid_js_rounded_ints # only useful when targeting JS runtime
53
53
- avoid_null_checks_in_equality_operators
54
54
# - avoid_positional_boolean_parameters # not yet tested
55
+
# - avoid_print # not yet tested
55
56
# - avoid_private_typedef_functions # we prefer having typedef (discussion in https://github.com/flutter/flutter/pull/16356)
57
+
# - avoid_redundant_argument_values # not yet tested
56
58
- avoid_relative_lib_imports
57
59
- avoid_renaming_method_parameters
58
60
- avoid_return_types_on_setters
@@ -61,43 +63,57 @@ linter:
61
63
- avoid_returning_null_for_void
62
64
# - avoid_returning_this # there are plenty of valid reasons to return this
63
65
# - avoid_setters_without_getters # not yet tested
64
-
#- avoid_shadowing_type_parameters # not yet tested
65
-
#- avoid_single_cascade_in_expression_statements # not yet tested
66
+
- avoid_shadowing_type_parameters
67
+
- avoid_single_cascade_in_expression_statements
66
68
- avoid_slow_async_io
69
+
- avoid_type_to_string
67
70
- avoid_types_as_parameter_names
68
71
# - avoid_types_on_closure_parameters # conflicts with always_specify_types
72
+
- avoid_unnecessary_containers
69
73
- avoid_unused_constructor_parameters
70
74
- avoid_void_async
75
+
# - avoid_web_libraries_in_flutter # not yet tested
71
76
- await_only_futures
77
+
- camel_case_extensions
72
78
- camel_case_types
73
79
- cancel_subscriptions
74
80
# - cascade_invocations # not yet tested
81
+
- cast_nullable_to_non_nullable
75
82
# - close_sinks # not reliable enough
76
-
# - comment_references # blocked on https://github.com/flutter/flutter/issues/20765
83
+
# - comment_references # blocked on https://github.com/dart-lang/linter/issues/1142
77
84
# - constant_identifier_names # needs an opt-out https://github.com/dart-lang/linter/issues/204
78
85
- control_flow_in_finally
79
-
# - curly_braces_in_flow_control_structures # not yet tested
86
+
# - curly_braces_in_flow_control_structures # not required by flutter style
87
+
- deprecated_consistency
80
88
# - diagnostic_describe_all_properties # not yet tested
81
89
- directives_ordering
90
+
# - do_not_use_environment # we do this commonly
82
91
- empty_catches
83
92
- empty_constructor_bodies
84
93
- empty_statements
85
-
# - file_names # not yet tested
94
+
- exhaustive_cases
95
+
- file_names
86
96
- flutter_style_todos
87
97
- hash_and_equals
88
98
- implementation_imports
89
99
# - invariant_booleans # too many false positives: https://github.com/dart-lang/linter/issues/811
90
100
- iterable_contains_unrelated_type
91
-
# - join_return_with_assignment # not yet tested
101
+
# - join_return_with_assignment # not required by flutter style
102
+
- leading_newlines_in_multiline_strings
92
103
- library_names
93
104
- library_prefixes
94
-
# - lines_longer_than_80_chars # not yet tested
105
+
# - lines_longer_than_80_chars # not required by flutter style
95
106
- list_remove_unrelated_type
96
107
# - literal_only_boolean_expressions # too many false positives: https://github.com/dart-lang/sdk/issues/34181
108
+
- missing_whitespace_between_adjacent_strings
97
109
- no_adjacent_strings_in_list
110
+
# - no_default_cases # too many false positives
98
111
- no_duplicate_case_values
112
+
- no_logic_in_create_state
113
+
# - no_runtimeType_toString # ok in tests; we enable this only in packages/
99
114
- non_constant_identifier_names
100
-
# - null_closures # not yet tested
115
+
- null_check_on_nullable_type_parameter
116
+
- null_closures
101
117
# - omit_local_variable_types # opposite of always_specify_types
102
118
# - one_member_abstracts # too many false positives
0 commit comments