Skip to content

Commit dcbc098

Browse files
committed
Adhere to DCM 1.12.0
1 parent ac2d565 commit dcbc098

File tree

2 files changed

+29
-5
lines changed

2 files changed

+29
-5
lines changed

CHANGELOG.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
- Add DCM rule prefer-correct-error-name with `e` for error
33
- Add DCM rule prefer-widget-private-members
44
- Remove DCM rule banned-dependencies since we do not configure it (and add comment so we know it's ok)
5-
- Adhere to DCM 1.11.0:
5+
- Adhere to DCM 1.11.0 and 1.12.0:
66
- Add avoid-duplicate-cascades
77
- Add avoid-duplicate-switch-case-conditions
88
- Add avoid-unnecessary-local-late
@@ -16,6 +16,15 @@
1616
- Add prefer-typedefs-for-callbacks
1717
- Add prefer-unique-test-names
1818
- Add prefer-widget-private-members
19+
- Add avoid-inferrable-type-arguments
20+
- Add prefer-switch-with-enums
21+
- Add avoid-misused-test-matchers
22+
- Add prefer-any-or-every
23+
- Add avoid-duplicate-test-assertions
24+
- Add avoid-conditional-hooks
25+
- Add avoid-hooks-outside-build
26+
- Add prefer-use-prefix
27+
- Update function-always-returns-null - disable in useEffect
1928

2029
## 5.0.0
2130
- Adhere to DCM 1.10.0:

lib/dcm.yaml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# version 1.10.0 - https://dcm.dev/changelog/
1+
# version 1.12.0 - https://dcm.dev/changelog/
22
dart_code_metrics:
33
rules:
44
### Common
@@ -25,6 +25,7 @@ dart_code_metrics:
2525
- avoid-duplicate-named-imports
2626
- avoid-duplicate-patterns
2727
- avoid-duplicate-switch-case-conditions
28+
- avoid-duplicate-test-assertions
2829
- avoid-dynamic
2930
- avoid-equal-expressions
3031
- avoid-explicit-pattern-field-name
@@ -37,7 +38,11 @@ dart_code_metrics:
3738
- avoid-identical-exception-handling-blocks
3839
- avoid-ignoring-return-values
3940
- avoid-importing-entrypoint-exports
40-
# - avoid-inferrable-type-arguments # TODO, after config to ignore context.read and context.watch is added
41+
- avoid-inferrable-type-arguments:
42+
ignored-invocations:
43+
- context.read
44+
- context.watch
45+
- GetIt.I
4146
- avoid-inverted-boolean-checks
4247
- avoid-keywords-in-wildcard-pattern
4348
# - avoid-late-keyword
@@ -95,7 +100,7 @@ dart_code_metrics:
95100
- avoid-throw-in-catch-block
96101
- avoid-throw-objects-without-tostring
97102
- avoid-top-level-members-in-tests
98-
- avoid-unassigned-late-fields-keyword
103+
- avoid-unassigned-late-fields
99104
- avoid-uncaught-future-errors
100105
- avoid-unconditional-break
101106
- avoid-unnecessary-call
@@ -126,7 +131,9 @@ dart_code_metrics:
126131
- format-comment:
127132
only-doc-comments: true
128133
# - format-test-name # good but painful
129-
- function-always-returns-null
134+
- function-always-returns-null:
135+
ignored-invocations:
136+
- useEffect
130137
- map-keys-ordering:
131138
exclude:
132139
- test/**
@@ -189,6 +196,7 @@ dart_code_metrics:
189196
- no-object-declaration
190197
# - parameters-ordering # way too strict
191198
# - prefer-addition-subtraction-assignments # dunno
199+
- prefer-any-or-every
192200
- prefer-async-await
193201
- prefer-both-inlining-annotations
194202
- prefer-bytes-builder
@@ -241,6 +249,7 @@ dart_code_metrics:
241249
ignore-names:
242250
- (.*)Provider
243251
- use(.*)
252+
- prefer-switch-with-enums
244253
- prefer-test-matchers
245254
- prefer-trailing-comma
246255
# - prefer-type-over-var # we prefer type inference
@@ -252,6 +261,7 @@ dart_code_metrics:
252261
exclude:
253262
- test/**
254263
# - avoid-missing-test-files # * OK, but should be enabled per project
264+
- avoid-misused-test-matchers
255265
- prefer-wildcard-pattern
256266
- tag-name
257267
- unnecessary-trailing-comma:
@@ -331,6 +341,11 @@ dart_code_metrics:
331341
- avoid-functions-in-register-singleton:
332342
severity: error
333343

344+
### Flutter Hooks
345+
- avoid-conditional-hooks
346+
- avoid-hooks-outside-build
347+
- prefer-use-prefix
348+
334349
### Intl - not used
335350
# - prefer-date-format
336351
# - prefer-intl-name

0 commit comments

Comments
 (0)