1
- # version 1.6 .0 - https://dcm.dev/changelog/
1
+ # version 1.7 .0 - https://dcm.dev/changelog/
2
2
dart_code_metrics :
3
3
pubspec-rules :
4
4
# ## Pubspec
@@ -14,9 +14,11 @@ dart_code_metrics:
14
14
rules :
15
15
# ## Common
16
16
# - arguments-ordering # way too pedantic
17
+ - avoid-accessing-other-classes-private-members
17
18
# - avoid-banned-file-names
18
19
# - avoid-banned-imports
19
20
# - avoid-banned-types
21
+ # - avoid-barrel-files # for now we use them
20
22
- avoid-bottom-type-in-patterns
21
23
- avoid-bottom-type-in-records
22
24
- avoid-cascade-after-if-null
@@ -33,23 +35,33 @@ dart_code_metrics:
33
35
# - avoid-explicit-type-declaration # public API
34
36
- avoid-function-type-in-records
35
37
- avoid-future-tostring
38
+ - avoid-generics-shadowing
36
39
- avoid-global-state
37
40
- avoid-ignoring-return-values
41
+ # - avoid-importing-entrypoint-exports: false # TODO: has false positives in monorepo
38
42
- avoid-inverted-boolean-checks
43
+ - avoid-keywords-in-wildcard-pattern
39
44
# - avoid-late-keyword
40
45
# - avoid-long-functions # way too pedantic
41
- - avoid-long-parameter-list :
42
- ignore-optional : true # exclude optional and (required) named parameters
46
+ # - avoid-long-parameter-list: # way too pedantic
47
+ # ignore-optional: true # exclude optional and (non- required) named parameters
43
48
- avoid-long-records
44
49
- avoid-missed-calls
45
50
- avoid-missing-enum-constant-in-map
51
+ - avoid-misused-wildcard-pattern
46
52
- avoid-mixing-named-and-positional-fields
53
+ # - avoid-mutating-parameters # we use ValueNotifier etc.
54
+ # - avoid-negated-conditions # sometimes it might be better
47
55
- avoid-nested-conditional-expressions :
48
56
acceptable-level : 2
57
+ - avoid-nested-futures
49
58
- avoid-nested-records
59
+ - avoid-nested-streams-and-futures
50
60
- avoid-nested-switch-expressions
51
61
- avoid-nested-switches
52
- - avoid-non-ascii-symbols
62
+ - avoid-non-ascii-symbols :
63
+ exclude :
64
+ - test/**
53
65
- avoid-non-null-assertion :
54
66
exclude :
55
67
- test/**
@@ -64,6 +76,7 @@ dart_code_metrics:
64
76
- avoid-redundant-pragma-inline
65
77
- avoid-self-assignment
66
78
- avoid-self-compare
79
+ - avoid-shadowed-extension-methods
67
80
- avoid-shadowing :
68
81
ignore-parameters : true
69
82
ignored-names :
@@ -74,7 +87,10 @@ dart_code_metrics:
74
87
- avoid-throw-objects-without-tostring
75
88
- avoid-top-level-members-in-tests
76
89
- avoid-unassigned-late-fields-keyword
90
+ - avoid-uncaught-future-errors
91
+ - avoid-unnecessary-call
77
92
- avoid-unnecessary-conditionals
93
+ - avoid-unnecessary-futures
78
94
- avoid-unnecessary-negations
79
95
- avoid-unnecessary-nullable-return-type
80
96
- avoid-unnecessary-return
@@ -92,6 +108,9 @@ dart_code_metrics:
92
108
only-doc-comments : true
93
109
# - format-test-name # good but painful
94
110
- function-always-returns-null
111
+ - map-keys-ordering :
112
+ exclude :
113
+ - test/**
95
114
# - match-positional-field-names-on-assignment # not compatible with avoid-redundant-positional-field-name
96
115
- member-ordering :
97
116
order :
@@ -122,7 +141,8 @@ dart_code_metrics:
122
141
min-fields : 3
123
142
min-occurrences : 3
124
143
- newline-before-return
125
- - no-boolean-literal-compare
144
+ - no-boolean-literal-compare :
145
+ allow-false : true # allows `variable == false` instead of just `!variable`
126
146
- no-empty-block
127
147
- no-equal-arguments :
128
148
ignored-parameters :
@@ -137,6 +157,7 @@ dart_code_metrics:
137
157
- bottomLeft
138
158
- bottomRight
139
159
- no-equal-conditions
160
+ - no-equal-nested-conditions
140
161
- no-equal-switch-case
141
162
- no-equal-switch-expression-cases
142
163
- no-equal-then-else
@@ -146,7 +167,10 @@ dart_code_metrics:
146
167
- prefer-bytes-builder
147
168
- prefer-commenting-analyzer-ignores
148
169
- prefer-conditional-expressions
170
+ # - prefer-correct-error-name # we use `e`
171
+ - prefer-correct-future-return-type
149
172
# - prefer-correct-identifier-length # way too pedantic
173
+ - prefer-correct-stream-return-type
150
174
- prefer-correct-switch-length
151
175
- prefer-correct-test-file-name
152
176
- prefer-correct-type-name
@@ -163,6 +187,9 @@ dart_code_metrics:
163
187
- test/**
164
188
- prefer-moving-to-variable :
165
189
allowed-duplicated-chains : 3
190
+ exclude :
191
+ - test/**
192
+ - prefer-parentheses-with-if-null
166
193
- prefer-return-await
167
194
# - prefer-returning-conditional-expressions # annoying sometimes
168
195
- prefer-simpler-patterns-null-check
@@ -172,7 +199,8 @@ dart_code_metrics:
172
199
- (.*)Provider
173
200
- use(.*)
174
201
- prefer-test-matchers
175
- # - prefer-trailing-comma # already in Dart lints - require_trailing_commas
202
+ - prefer-trailing-comma
203
+ # - prefer-type-over-var # we prefer inference
176
204
# - prefer-unwrapping-future-or # we are ok with awaiting values
177
205
- prefer-visible-for-testing-on-members
178
206
- prefer-wildcard-pattern
@@ -189,10 +217,12 @@ dart_code_metrics:
189
217
- avoid-incomplete-copy-with
190
218
- avoid-inherited-widget-in-initstate
191
219
- avoid-late-context
220
+ - avoid-missing-image-alt
192
221
- avoid-returning-widgets
193
222
- avoid-shrink-wrap-in-lists
194
223
- avoid-state-constructors
195
224
- avoid-stateless-widget-initialized-fields
225
+ - avoid-unnecessary-overrides-in-state
196
226
- avoid-unnecessary-setstate
197
227
- avoid-unnecessary-stateful-widgets
198
228
- avoid-wrapping-in-padding
@@ -202,6 +232,7 @@ dart_code_metrics:
202
232
- prefer-action-button-tooltip
203
233
- prefer-const-border-radius
204
234
- prefer-correct-edge-insets-constructor
235
+ - prefer-dedicated-media-query-methods
205
236
- prefer-define-hero-tag
206
237
- prefer-extracting-callbacks
207
238
- prefer-single-widget-per-file :
0 commit comments