Repository: javierbrea/eslint-plugin-boundaries
Pull request #321 (2023-12-01 19:38:14)

Release v4.0.1
### Fixed
- fix: Avoid error when rule element matchers define a capture key but some element does not have that capture key


Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9438133..1cb8161 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,12 +11,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
 ### Removed
 ### BREAKING CHANGES
 
+## [4.0.1] - 2023-12-01
+
+### Fixed
+- fix: Avoid error when rule element matchers define a capture key but some element does not have that capture key
+
 ## [4.0.0] - 2023-12-01
 
 ### Added
 
-- feat(#213): Add `dependency-nodes` setting to allow analyzing dependencies from additional nodes, such as exports or dynamic imports.
-- feat: Add `additional-dependency-nodes` setting to add custom dependency nodes to the default ones. For example, you could enable to analyze dependencies in `jest.mock(...)`, etc.
+- feat(#213): Add `dependency-nodes` setting to allow analyzing dependencies from additional nodes, such as exports or dynamic imports. ([@gridsane](https://github.com/gridsane))
+- feat: Add `additional-dependency-nodes` setting to add custom dependency nodes to the default ones. For example, you could enable to analyze dependencies in `jest.mock(...)`, etc. ([@gridsane](https://github.com/gridsane))
 
 ### BREAKING CHANGES
 
diff --git a/package-lock.json b/package-lock.json
index df3a9b6..f621177 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
 {
   "name": "eslint-plugin-boundaries",
-  "version": "4.0.0",
+  "version": "4.0.1",
   "lockfileVersion": 2,
   "requires": true,
   "packages": {
     "": {
       "name": "eslint-plugin-boundaries",
-      "version": "4.0.0",
+      "version": "4.0.1",
       "license": "MIT",
       "dependencies": {
         "chalk": "4.1.2",
diff --git a/package.json b/package.json
index 09ffc0c..1842f55 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "eslint-plugin-boundaries",
-  "version": "4.0.0",
+  "version": "4.0.1",
   "description": "Eslint plugin checking architecture boundaries between elements",
   "keywords": [
     "eslint",
diff --git a/sonar-project.properties b/sonar-project.properties
index f0ea153..00e14cb 100644
--- a/sonar-project.properties
+++ b/sonar-project.properties
@@ -1,6 +1,6 @@
 sonar.organization=javierbrea
 sonar.projectKey=javierbrea_eslint-plugin-boundaries
-sonar.projectVersion=4.0.0
+sonar.projectVersion=4.0.1
 
 sonar.javascript.file.suffixes=.js
 sonar.sourceEncoding=UTF-8
diff --git a/src/helpers/rules.js b/src/helpers/rules.js
index ae2ee53..33614b3 100644
--- a/src/helpers/rules.js
+++ b/src/helpers/rules.js
@@ -45,7 +45,7 @@ function micromatchPatternReplacingObjectsValues(pattern, object) {
 function isObjectMatch(objectWithMatchers, object, objectsWithValuesToReplace) {
   return Object.keys(objectWithMatchers).reduce((isMatch, key) => {
     if (isMatch) {
-      if (!object) {
+      if (!object || !object[key]) {
         return false;
       }
       const micromatchPattern = micromatchPatternReplacingObjectsValues(


Test patch:
diff --git a/test/rules/one-level/element-types.spec.js b/test/rules/one-level/element-types.spec.js
index 6c9bb9e..828d193 100644
--- a/test/rules/one-level/element-types.spec.js
+++ b/test/rules/one-level/element-types.spec.js
@@ -749,6 +749,10 @@ testCapture(
           from: "modules",
           allow: [["h*", { elementName: "*-a" }], "c*", "m*"],
         },
+        {
+          from: "modules",
+          disallow: [["h*", { foo: "*-a" }], "c*", "m*"],
+        },
       ],
     },
   ],