1
- # version 1.10 .0 - https://dcm.dev/changelog/
1
+ # version 1.12 .0 - https://dcm.dev/changelog/
2
2
dart_code_metrics :
3
3
rules :
4
4
# ## Common
5
5
# - arguments-ordering # way too pedantic
6
6
- avoid-accessing-collections-by-constant-index
7
7
- avoid-accessing-other-classes-private-members
8
8
- avoid-async-call-in-sync-function
9
- # - avoid-banned-file-names
10
- # - avoid-banned-imports
11
- # - avoid-banned-types
9
+ # - avoid-banned-annotations # * OK, we just don't have global config
10
+ # - avoid-banned-file-names # * OK, we just don't have global config
11
+ # - avoid-banned-imports # * OK, we just don't have global config
12
+ # - avoid-banned-types # * OK, we just don't have global config
12
13
# - avoid-barrel-files # for now we use them
13
14
- avoid-bottom-type-in-patterns
14
15
- avoid-bottom-type-in-records
15
16
- avoid-cascade-after-if-null
16
17
- avoid-collapsible-if
17
18
- avoid-collection-methods-with-unrelated-types
19
+ # - avoid-collection-mutating-methods # sometimes it's ok
18
20
- avoid-declaring-call-method
19
21
- avoid-double-slash-imports
22
+ - avoid-duplicate-cascades
20
23
- avoid-duplicate-exports
21
24
- avoid-duplicate-mixins
22
25
- avoid-duplicate-named-imports
23
26
- avoid-duplicate-patterns
27
+ - avoid-duplicate-switch-case-conditions
28
+ - avoid-duplicate-test-assertions
24
29
- avoid-dynamic
25
30
- avoid-equal-expressions
26
31
- avoid-explicit-pattern-field-name
@@ -33,14 +38,19 @@ dart_code_metrics:
33
38
- avoid-identical-exception-handling-blocks
34
39
- avoid-ignoring-return-values
35
40
- avoid-importing-entrypoint-exports
41
+ - avoid-inferrable-type-arguments :
42
+ ignored-invocations :
43
+ - context.read
44
+ - context.watch
45
+ - GetIt.I
36
46
- avoid-inverted-boolean-checks
37
47
- avoid-keywords-in-wildcard-pattern
38
48
# - avoid-late-keyword
39
49
- avoid-local-functions
40
50
# - avoid-long-files # hard to get the right settings
41
51
# - avoid-long-functions # way too pedantic
42
52
# - avoid-long-parameter-list: # way too pedantic
43
- # ignore-optional: true # exclude optional and (non-required) named parameters
53
+ # ignore-optional: true # exclude optional and (non-required) named parameters
44
54
- avoid-long-records
45
55
- avoid-map-keys-contains
46
56
- avoid-missed-calls
@@ -90,19 +100,20 @@ dart_code_metrics:
90
100
- avoid-throw-in-catch-block
91
101
- avoid-throw-objects-without-tostring
92
102
- avoid-top-level-members-in-tests
93
- - avoid-unassigned-late-fields-keyword
103
+ - avoid-unassigned-late-fields
94
104
- avoid-uncaught-future-errors
95
105
- avoid-unconditional-break
96
106
- avoid-unnecessary-call
97
107
- avoid-unnecessary-conditionals
98
108
- avoid-unnecessary-futures
99
109
# - avoid-unnecessary-getter # it's ok to have getter for private field
100
110
- avoid-unnecessary-if
101
- - avoid-unnecessary-late
111
+ - avoid-unnecessary-local- late
102
112
- avoid-unnecessary-negations
103
113
- avoid-unnecessary-nullable-return-type
104
114
- avoid-unnecessary-reassignment
105
115
- avoid-unnecessary-return
116
+ - avoid-unnecessary-super
106
117
- avoid-unnecessary-type-assertions
107
118
- avoid-unnecessary-type-casts
108
119
- avoid-unrelated-type-assertions
@@ -113,19 +124,22 @@ dart_code_metrics:
113
124
- avoid-unused-parameters
114
125
- avoid-weak-cryptographic-algorithms
115
126
- avoid-wildcard-cases-with-enums
116
- # - banned-usage
127
+ # - banned-usage # * OK, we just don't have global config
117
128
- binary-expression-operand-order
118
129
- double-literal-format
119
130
- enum-constants-ordering
120
131
- format-comment :
121
132
only-doc-comments : true
122
133
# - format-test-name # good but painful
123
- - function-always-returns-null
134
+ - function-always-returns-null :
135
+ ignored-invocations :
136
+ - useEffect
124
137
- map-keys-ordering :
125
138
exclude :
126
139
- test/**
127
140
- match-class-name-pattern
128
141
# - match-getter-setter-field-names # forces API to equals internal code
142
+ # - match-lib-folder-structure # maybe later
129
143
# - match-positional-field-names-on-assignment # not compatible with avoid-redundant-positional-field-name
130
144
- member-ordering :
131
145
order :
@@ -181,25 +195,35 @@ dart_code_metrics:
181
195
# - no-magic-number: # way too strict for default values of parameters etc.
182
196
- no-object-declaration
183
197
# - parameters-ordering # way too strict
198
+ # - prefer-addition-subtraction-assignments # dunno
199
+ - prefer-any-or-every
184
200
- prefer-async-await
201
+ - prefer-both-inlining-annotations
185
202
- prefer-bytes-builder
186
203
- prefer-commenting-analyzer-ignores
187
204
- prefer-conditional-expressions
188
- # - prefer-correct-error-name # we use `e`
205
+ - prefer-correct-callback-field-name
206
+ - prefer-correct-error-name :
207
+ allowed-names :
208
+ - e
189
209
- prefer-correct-for-loop-increment
190
210
- prefer-correct-future-return-type
211
+ # - prefer-correct-handler-name # not now
191
212
# - prefer-correct-identifier-length # way too pedantic
192
213
# - prefer-correct-json-casts # overkill
214
+ - prefer-correct-setter-parameter-name
193
215
- prefer-correct-stream-return-type
194
216
- prefer-correct-switch-length
195
217
- prefer-correct-test-file-name
196
218
- prefer-correct-type-name
197
219
- prefer-declaring-const-constructor
198
220
- prefer-early-return
199
221
- prefer-enums-by-name
222
+ - prefer-explicit-function-type
200
223
- prefer-explicit-parameter-names
224
+ # - prefer-explicit-type-arguments # inference is better
201
225
- prefer-first
202
- # - prefer-getter-over-method # way to pedantic
226
+ # - prefer-getter-over-method # way too pedantic
203
227
- prefer-immediate-return
204
228
- prefer-iterable-of
205
229
- prefer-last
@@ -211,25 +235,33 @@ dart_code_metrics:
211
235
exclude :
212
236
- test/**
213
237
- prefer-named-boolean-parameters
214
- # - prefer-named-imports # ok, but we don't have a usecase now
238
+ # - prefer-named-imports # * OK, we just don't have global config
239
+ - prefer-null-aware-spread
215
240
- prefer-parentheses-with-if-null
241
+ # - prefer-prefixed-global-constants # * OK, we just don't have global config
216
242
- prefer-public-exception-classes
217
243
- prefer-return-await
218
244
# - prefer-returning-conditional-expressions # annoying sometimes
219
245
- prefer-simpler-patterns-null-check
246
+ - prefer-specific-cases-first
220
247
- prefer-static-class :
221
248
ignore-private : true
222
249
ignore-names :
223
250
- (.*)Provider
224
251
- use(.*)
252
+ - prefer-switch-with-enums
225
253
- prefer-test-matchers
226
254
- prefer-trailing-comma
227
- # - prefer-type-over-var # we prefer inference
255
+ # - prefer-type-over-var # we prefer type inference
256
+ - prefer-typedefs-for-callbacks
257
+ - prefer-unique-test-names
228
258
# - prefer-unwrapping-future-or # we are ok with awaiting values
229
259
- prefer-visible-for-testing-on-members
230
260
- avoid-missing-interpolation :
231
261
exclude :
232
262
- test/**
263
+ # - avoid-missing-test-files # * OK, but should be enabled per project
264
+ - avoid-misused-test-matchers
233
265
- prefer-wildcard-pattern
234
266
- tag-name
235
267
- unnecessary-trailing-comma :
@@ -269,7 +301,7 @@ dart_code_metrics:
269
301
- prefer-sliver-prefix
270
302
- prefer-text-rich
271
303
- prefer-using-list-view
272
- # - prefer-widget-private-members # cannot use this.field in constructor
304
+ - prefer-widget-private-members
273
305
- proper-super-calls
274
306
- use-setstate-synchronously
275
307
@@ -302,13 +334,18 @@ dart_code_metrics:
302
334
- prefer-custom-finder-over-find
303
335
- prefer-symbol-over-key
304
336
305
- # # Fake Async
337
+ # ## Fake Async
306
338
- avoid-async-callback-in-fake-async
307
339
308
- # # Get It
340
+ # ## Get It
309
341
- avoid-functions-in-register-singleton :
310
342
severity : error
311
343
344
+ # ## Flutter Hooks
345
+ - avoid-conditional-hooks
346
+ - avoid-hooks-outside-build
347
+ - prefer-use-prefix
348
+
312
349
# ## Intl - not used
313
350
# - prefer-date-format
314
351
# - prefer-intl-name
@@ -326,9 +363,9 @@ dart_code_metrics:
326
363
# ## Pubspec
327
364
- avoid-any-version
328
365
# - avoid-dependency-overrides
329
- - banned-dependencies
366
+ # - banned-dependencies # * OK, we just don't have global config
330
367
- prefer-caret-version-syntax
331
- # - prefer-correct-package-name
368
+ # - prefer-correct-package-name # * OK, we just don't have global config
332
369
- prefer-correct-screenshots
333
370
- prefer-publish-to-none
334
371
- prefer-semver-version
0 commit comments