-
Notifications
You must be signed in to change notification settings - Fork 0
/
analysis_options.yaml
185 lines (178 loc) · 5.26 KB
/
analysis_options.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
include: package:lint/analysis_options.yaml
analyzer:
plugins:
- dart_code_metrics
exclude:
- '.fvm/**'
language:
strict-raw-types: true
strong-mode:
implicit-dynamic: true
errors:
invalid_annotation_target: error
argument_type_not_assignable: error
field_initializer_not_assignable: error
map_value_type_not_assignable: error
invalid_assignment: error
return_of_invalid_type_from_closure: error
return_of_invalid_type: error
unnecessary_new: warning
sort_pub_dependencies: ignore
avoid_setters_without_getters: ignore
import_of_legacy_library_into_null_safe: error
avoid_single_cascade_in_expression_statements: ignore
null_aware_in_logical_operator: error
missing_required_param: error
implicit_dynamic_map_literal: ignore
prefer_single_quotes: ignore
missing_return: error
always_declare_return_types: error
override_on_non_overriding_member: error
annotate_overrides: error
avoid_relative_lib_imports: error
avoid_empty_else: error
avoid_returning_null_for_future: error
empty_statements: error
always_put_control_body_on_new_line: error
always_require_non_null_named_parameters: error
avoid_renaming_method_parameters: error
avoid_void_async: error
parameter_assignments: error
constant_identifier_names: ignore
unawaited_futures: error
non_constant_identifier_names: ignore
only_throw_errors: error
exhaustive_cases: error
always_use_package_imports: error
missing_enum_constant_in_switch: error
prefer_const_constructors: error
depend_on_referenced_packages: ignore
use_setters_to_change_properties: ignore
avoid_classes_with_only_static_members: ignore
avoid_positional_boolean_parameters: error
avoid_dynamic_calls: error
require_trailing_commas: error
linter:
rules:
- avoid_unnecessary_containers
- no_logic_in_create_state
- constant_identifier_names
- prefer_const_constructors
- prefer_const_constructors_in_immutables
- prefer_const_declarations
- prefer_const_literals_to_create_immutables
- annotate_overrides
- await_only_futures
- camel_case_types
- cancel_subscriptions
- close_sinks
- comment_references
- control_flow_in_finally
- empty_statements
- always_declare_return_types
- avoid_empty_else
- avoid_relative_lib_imports
- avoid_returning_null_for_future
- always_put_control_body_on_new_line
- always_require_non_null_named_parameters
- avoid_renaming_method_parameters
- avoid_void_async
- parameter_assignments
- file_names
- empty_constructor_bodies
- unnecessary_parenthesis
- unnecessary_overrides
- use_rethrow_when_possible
- always_use_package_imports
- avoid_init_to_null
- avoid_null_checks_in_equality_operators
- avoid_return_types_on_setters
- avoid_shadowing_type_parameters
- avoid_types_as_parameter_names
- camel_case_extensions
- curly_braces_in_flow_control_structures
- empty_catches
- library_names
- library_prefixes
- no_duplicate_case_values
- null_closures
- omit_local_variable_types
- prefer_adjacent_string_concatenation
- prefer_collection_literals
- prefer_conditional_assignment
- prefer_contains
- prefer_equal_for_default_values
- prefer_final_fields
- prefer_for_elements_to_map_fromIterable
- prefer_generic_function_type_aliases
- prefer_if_null_operators
- prefer_is_empty
- prefer_is_not_empty
- prefer_iterable_whereType
- prefer_single_quotes
- prefer_spread_collections
- recursive_getters
- slash_for_doc_comments
- type_init_formals
- unawaited_futures
- unnecessary_const
- unnecessary_new
- unnecessary_null_in_if_null_operators
- unnecessary_this
- unrelated_type_equality_checks
- use_function_type_syntax_for_parameters
- valid_regexps
- exhaustive_cases
- require_trailing_commas
dart_code_metrics:
anti-patterns:
- long-method
- long-parameter-list
metrics:
cyclomatic-complexity: 15
maximum-nesting-level: 3
number-of-parameters: 4
source-lines-of-code: 30
metrics-exclude:
- "test/**"
- "**/*.gen.dart"
rules-exclude:
- "test/**"
- "widgetbook/**"
- "**/*.gen.dart"
rules:
- no-boolean-literal-compare
- no-empty-block
- prefer-trailing-comma:
break-on: 3
- prefer-conditional-expressions
- no-equal-then-else
- avoid-unnecessary-type-casts
- avoid-unnecessary-type-assertions
- no-magic-number
- prefer-first
- prefer-last
- prefer-match-file-name
- avoid-use-expanded-as-spacer
- prefer-extracting-callbacks
- prefer-async-await
- prefer-moving-to-variable
- avoid-returning-widgets
- prefer-correct-identifier-length:
exceptions: [ 'i' ]
max-identifier-length: 40
min-identifier-length: 2
- prefer-correct-type-name:
min-length: 2
max-length: 40
- prefer-single-widget-per-file:
ignore-private-widgets: true
- member-ordering:
order:
- constructors
- public-fields
- private-fields
- public-getters
- private-getters
- public-methods
- private-methods