1
+ # version 1.6.0
1
2
dart_code_metrics :
3
+ pubspec-rules :
4
+ # ## Pubspec
5
+ - avoid-any-version
6
+ # - avoid-dependency-overrides
7
+ - banned-dependencies
8
+ - prefer-caret-version-syntax
9
+ # - prefer-correct-package-name
10
+ - prefer-correct-screenshots
11
+ - prefer-publish-to-none
12
+ - prefer-semver-version
13
+
2
14
rules :
3
- # ## Dart
15
+ # ## Common
4
16
# - arguments-ordering # way too pedantic
5
- - avoid-banned-imports
17
+ # - avoid-banned-file-names
18
+ # - avoid-banned-imports
19
+ # - avoid-banned-types
20
+ - avoid-bottom-type-in-patterns
21
+ - avoid-bottom-type-in-records
6
22
- avoid-cascade-after-if-null
23
+ - avoid-collapsible-if
7
24
- avoid-collection-methods-with-unrelated-types
25
+ - avoid-declaring-call-method
8
26
- avoid-double-slash-imports
9
27
- avoid-duplicate-exports
28
+ - avoid-duplicate-named-imports
29
+ - avoid-duplicate-patterns
10
30
- avoid-dynamic
31
+ - avoid-equal-expressions
32
+ - avoid-explicit-pattern-field-name
33
+ # - avoid-explicit-type-declaration # public API
34
+ - avoid-function-type-in-records
35
+ - avoid-future-tostring
11
36
- avoid-global-state
12
37
- avoid-ignoring-return-values
38
+ - avoid-inverted-boolean-checks
13
39
# - avoid-late-keyword
40
+ # - avoid-long-functions # way too pedantic
41
+ # - avoid-long-parameter-list # doesn't play well with Flutter
42
+ - avoid-long-records
43
+ - avoid-missed-calls
14
44
- avoid-missing-enum-constant-in-map
45
+ - avoid-mixing-named-and-positional-fields
15
46
- avoid-nested-conditional-expressions :
16
47
acceptable-level : 2
48
+ - avoid-nested-records
49
+ - avoid-nested-switch-expressions
50
+ - avoid-nested-switches
17
51
- avoid-non-ascii-symbols
18
52
- avoid-non-null-assertion :
19
53
exclude :
20
54
- test/**
55
+ - avoid-one-field-records
21
56
- avoid-passing-async-when-sync-expected :
22
57
exclude :
23
58
- test/**
59
+ - avoid-positional-record-field-access
24
60
- avoid-redundant-async
61
+ - avoid-redundant-else
62
+ - avoid-redundant-positional-field-name
63
+ - avoid-redundant-pragma-inline
64
+ - avoid-self-assignment
65
+ - avoid-self-compare
66
+ - avoid-shadowing :
67
+ ignore-parameters : true
68
+ ignored-names :
69
+ - context
70
+ # - avoid-similar-names # way too pedantic
71
+ - avoid-substring
25
72
- avoid-throw-in-catch-block
73
+ - avoid-throw-objects-without-tostring
26
74
- avoid-top-level-members-in-tests
27
- - avoid-unnecessary-conditionals # already in Dart lints - avoid_bool_literals_in_conditional_expressions
75
+ - avoid-unassigned-late-fields-keyword
76
+ - avoid-unnecessary-conditionals
77
+ - avoid-unnecessary-negations
78
+ - avoid-unnecessary-nullable-return-type
79
+ - avoid-unnecessary-return
28
80
- avoid-unnecessary-type-assertions
29
81
- avoid-unnecessary-type-casts
30
82
- avoid-unrelated-type-assertions
83
+ - avoid-unrelated-type-casts
84
+ - avoid-unsafe-collection-methods
85
+ - avoid-unused-generics
31
86
- avoid-unused-parameters
32
- # - ban-name
87
+ # - banned-usage
33
88
- binary-expression-operand-order
34
89
- double-literal-format
35
- - format-comment
36
- - list-all-equatable-fields
90
+ - format-comment :
91
+ only-doc-comments : true
92
+ # - format-test-name # good but painful
93
+ - function-always-returns-null
94
+ # - match-positional-field-names-on-assignment # not compatible with avoid-redundant-positional-field-name
37
95
- member-ordering :
38
- # alphabetize: true
39
96
order :
40
97
- public-fields
41
98
- private-fields
@@ -59,28 +116,43 @@ dart_code_metrics:
59
116
- public-methods
60
117
- private-methods
61
118
- build-method
62
- - missing-test-assertion :
63
- include-assertions :
64
- - assertAllTrue
119
+ - missing-test-assertion
120
+ - move-records-to-typedefs :
121
+ min-fields : 3
122
+ min-occurrences : 3
65
123
- newline-before-return
66
124
- no-boolean-literal-compare
67
125
- no-empty-block
68
126
- no-equal-arguments :
69
127
ignored-parameters :
70
128
- height
71
129
- width
130
+ - top
131
+ - right
132
+ - bottom
133
+ - left
134
+ - topLeft
135
+ - topRight
136
+ - bottomLeft
137
+ - bottomRight
138
+ - no-equal-conditions
139
+ - no-equal-switch-case
140
+ - no-equal-switch-expression-cases
72
141
- no-equal-then-else
73
142
# - no-magic-number: # way to strict for default values of parameters etc.
74
- # exclude:
75
- # - test/**
76
143
- no-object-declaration
77
144
- prefer-async-await
145
+ - prefer-bytes-builder
78
146
- prefer-commenting-analyzer-ignores
79
147
- prefer-conditional-expressions
80
- # - prefer-correct-identifier-length
148
+ # - prefer-correct-identifier-length # way too pedantic
149
+ - prefer-correct-switch-length
81
150
- prefer-correct-test-file-name
82
151
- prefer-correct-type-name
152
+ - prefer-declaring-const-constructor
153
+ - prefer-early-return
83
154
- prefer-enums-by-name
155
+ - prefer-explicit-parameter-names
84
156
- prefer-first
85
157
- prefer-immediate-return
86
158
- prefer-iterable-of
@@ -90,37 +162,75 @@ dart_code_metrics:
90
162
- test/**
91
163
- prefer-moving-to-variable :
92
164
allowed-duplicated-chains : 3
165
+ - prefer-return-await
166
+ - prefer-returning-conditional-expressions
167
+ - prefer-simpler-patterns-null-check
93
168
- prefer-static-class :
94
169
ignore-private : true
95
170
ignore-names :
96
171
- (.*)Provider
97
172
- use(.*)
173
+ - prefer-test-matchers
98
174
# - prefer-trailing-comma # already in Dart lints - require_trailing_commas
175
+ # - prefer-unwrapping-future-or # we are ok with awaiting values
176
+ - prefer-visible-for-testing-on-members
177
+ - prefer-wildcard-pattern
99
178
- tag-name
179
+ - unnecessary-trailing-comma :
180
+ max-width : 80
100
181
101
182
# ## Flutter
183
+ - add-copy-with
102
184
- always-remove-listener
103
185
- avoid-border-all
186
+ - avoid-empty-setstate
187
+ - avoid-expanded-as-spacer
188
+ - avoid-incomplete-copy-with
189
+ - avoid-inherited-widget-in-initstate
190
+ - avoid-late-context
104
191
- avoid-returning-widgets
105
192
- avoid-shrink-wrap-in-lists
193
+ - avoid-state-constructors
194
+ - avoid-stateless-widget-initialized-fields
106
195
- avoid-unnecessary-setstate
107
- - use-setstate-synchronously
108
- - avoid-expanded-as-spacer
196
+ - avoid-unnecessary-stateful-widgets
109
197
- avoid-wrapping-in-padding
110
198
- check-for-equals-in-render-object-setters
111
199
- consistent-update-render-object
200
+ - dispose-fields
201
+ - prefer-action-button-tooltip
112
202
- prefer-const-border-radius
113
203
- prefer-correct-edge-insets-constructor
204
+ - prefer-define-hero-tag
114
205
- prefer-extracting-callbacks
115
206
- prefer-single-widget-per-file :
116
207
ignore-private-widgets : true
117
208
- prefer-using-list-view
209
+ # - prefer-widget-private-members # cannot use this.field in constructor
210
+ - proper-super-calls
211
+ - use-setstate-synchronously
212
+
213
+ # ## Provider
214
+ - avoid-instantiating-in-value-provider
215
+ - avoid-read-inside-build
216
+ - avoid-watch-outside-build
217
+ - dispose-providers
218
+ - prefer-multi-provider
219
+
220
+ # ## Bloc
221
+ - avoid-bloc-public-methods
222
+ # - avoid-cubits
223
+ # - avoid-passing-bloc-to-bloc
224
+ - check-is-not-closed-after-async-gap
225
+ - prefer-correct-bloc-provider
226
+ - prefer-multi-bloc-provider
227
+
228
+ # ## Equatable
229
+ - extend-equatable
230
+ - list-all-equatable-fields
231
+
232
+ # ## Flame - not used
118
233
119
- # ## Intl
120
- # - prefer-intl-name
121
- # - provide-correct-intl-args
234
+ # ## Intl - not used
122
235
123
- # ## Angular
124
- # - avoid-preserve-whitespace-false
125
- # - component-annotation-arguments-ordering
126
- # - prefer-on-push-cd-strategy
236
+ # ## Angular - not used
0 commit comments