eslint-plugin-boundaries 5.0.0 → 5.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-boundaries",
3
- "version": "5.0.0",
3
+ "version": "5.0.1",
4
4
  "description": "Eslint plugin checking architecture boundaries between elements",
5
5
  "keywords": [
6
6
  "eslint",
@@ -137,7 +137,7 @@ function isMatchElementType(
137
137
  return isMatchElementKey(elementInfo, matcher, options, "type", elementsToCompareCapturedValues);
138
138
  }
139
139
 
140
- function getElementRules(elementInfo, options, mainKey) {
140
+ function getElementRules(targetElement, options, mainKey, fromElement) {
141
141
  if (!options.rules) {
142
142
  return [];
143
143
  }
@@ -150,7 +150,7 @@ function getElementRules(elementInfo, options, mainKey) {
150
150
  };
151
151
  })
152
152
  .filter((rule) => {
153
- return ruleMatch(rule[key], elementInfo, isMatchElementType, elementInfo).result;
153
+ return ruleMatch(rule[key], targetElement, isMatchElementType, fromElement).result;
154
154
  });
155
155
  }
156
156
 
@@ -172,10 +172,12 @@ function elementRulesAllowDependency({
172
172
  isMatch,
173
173
  rulesMainKey: mainKey,
174
174
  }) {
175
+ const targetElement = elementToGetRulesFrom(element, dependency, mainKey);
175
176
  const [result, report, ruleReport] = getElementRules(
176
- elementToGetRulesFrom(element, dependency, mainKey),
177
+ targetElement,
177
178
  options,
178
179
  mainKey,
180
+ targetElement === element ? dependency : element,
179
181
  ).reduce(
180
182
  (allowed, rule) => {
181
183
  if (rule.disallow) {