From 61680fe5ac3c0288448bcdf085000db14bb51058 Mon Sep 17 00:00:00 2001 From: u221711 Date: Wed, 30 Oct 2024 00:23:27 +0100 Subject: [PATCH] small fix --- .../das_custom_lints/lib/dont_use_src_folder_imports.dart | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/das_client/das_custom_lints/lib/dont_use_src_folder_imports.dart b/das_client/das_custom_lints/lib/dont_use_src_folder_imports.dart index e5112770..783cf852 100644 --- a/das_client/das_custom_lints/lib/dont_use_src_folder_imports.dart +++ b/das_client/das_custom_lints/lib/dont_use_src_folder_imports.dart @@ -26,7 +26,7 @@ class DontUseSrcFolderImports extends DartLintRule { context.registry.addImportDirective((importDirective) { var importUri = importDirective.uri.stringValue; - if (importUri == null || !importUri.contains('src')) return; + if (importUri == null || !importUri.contains('/src/')) return; var filePath = importDirective.element!.source.fullName; if (!filePath.contains("/lib/")) return; @@ -39,7 +39,11 @@ class DontUseSrcFolderImports extends DartLintRule { if (fileParts[0].startsWith(importParts[0])) return; // report a lint error with the `code` and the respective import directive - reporter.atNode(importDirective, _code); + reporter.atNode(importDirective, LintCode( + name: _code.name, + problemMessage: 'Don\'t use source folder imports for importing ${importDirective.uri.stringValue}', + errorSeverity: ErrorSeverity.ERROR, + )); }); }