diff --git a/lib/validation/validateDependencyRules.js b/lib/validation/validateDependencyRules.js index 92b4fd2..db80ef6 100644 --- a/lib/validation/validateDependencyRules.js +++ b/lib/validation/validateDependencyRules.js @@ -25,7 +25,10 @@ function validateConfig(config, sourceFile, importRecord) { // Check whether: // 1) The import matches the rule // 2) If necessary, the source file has a relevant tag - if (minimatch(importRecord.rawImport, dependencyRule.dependency) && + if (minimatch(importRecord.rawImport, dependencyRule.dependency, { + matchBase: true, + nonegate: true, + }) && fileHasNecessaryTag_1.default(sourceFile, dependencyRule.accessibleTo)) { // A rule matched, so the dependency is valid return; diff --git a/src/validation/validateDependencyRules.ts b/src/validation/validateDependencyRules.ts index 9366447..2affe3d 100644 --- a/src/validation/validateDependencyRules.ts +++ b/src/validation/validateDependencyRules.ts @@ -28,8 +28,12 @@ function validateConfig(config: Config, sourceFile: NormalizedPath, importRecord // Check whether: // 1) The import matches the rule // 2) If necessary, the source file has a relevant tag + if ( - minimatch(importRecord.rawImport, dependencyRule.dependency) && + minimatch(importRecord.rawImport, dependencyRule.dependency, { + matchBase: true, + nonegate: true, + }) && fileHasNecessaryTag(sourceFile, dependencyRule.accessibleTo) ) { // A rule matched, so the dependency is valid