From 46e7c74cb2c380dda62a8938d85b85d2cb6ad7cc Mon Sep 17 00:00:00 2001 From: Tobias Wawrzinek Date: Tue, 23 Jan 2024 18:12:09 +0100 Subject: [PATCH] Add avoid-banned-imports --- lib/metrics.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/metrics.yaml b/lib/metrics.yaml index 04d8a20..eac77b3 100644 --- a/lib/metrics.yaml +++ b/lib/metrics.yaml @@ -52,6 +52,17 @@ dart_code_metrics: - test/** - integration_test/** - prefer-trailing-comma + - avoid-banned-imports: + entries: + - paths: ['lib\/domain(\/\w+)+\.dart'] + deny: ['^package:\w*\/ui(\/\w+)+\.dart$'] + message: 'Do not import UI classes within domain layer.' + - paths: ['lib\/infrastructure(\/\w+)+\.dart'] + deny: ['^package:\w*\/ui(\/\w+)+\.dart$'] + message: 'Do not import UI classes within infrastructure layer.' + - paths: ['lib\/domain(\/\w+)+\.dart'] + deny: ['^package:\w*\/infrastructure(\/\w+)+\.dart$'] + message: 'Do not import infrastructure layer classes within domain layer.' # Flutter - always-remove-listener