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 +1 -1
- package/src/helpers/rules.js +5 -3
package/package.json
CHANGED
package/src/helpers/rules.js
CHANGED
|
@@ -137,7 +137,7 @@ function isMatchElementType(
|
|
|
137
137
|
return isMatchElementKey(elementInfo, matcher, options, "type", elementsToCompareCapturedValues);
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
function getElementRules(
|
|
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],
|
|
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
|
-
|
|
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) {
|