eslint-plugin-boundaries 4.0.0 → 4.1.0
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
package/src/helpers/rules.js
CHANGED
|
@@ -45,7 +45,7 @@ function micromatchPatternReplacingObjectsValues(pattern, object) {
|
|
|
45
45
|
function isObjectMatch(objectWithMatchers, object, objectsWithValuesToReplace) {
|
|
46
46
|
return Object.keys(objectWithMatchers).reduce((isMatch, key) => {
|
|
47
47
|
if (isMatch) {
|
|
48
|
-
if (!object) {
|
|
48
|
+
if (!object || !object[key]) {
|
|
49
49
|
return false;
|
|
50
50
|
}
|
|
51
51
|
const micromatchPattern = micromatchPatternReplacingObjectsValues(
|
|
@@ -140,16 +140,20 @@ function validateElements(elements) {
|
|
|
140
140
|
}
|
|
141
141
|
if (element.mode && !VALID_MODES.includes(element.mode)) {
|
|
142
142
|
warnOnce(
|
|
143
|
-
`Invalid mode property
|
|
143
|
+
`Invalid mode property of type ${
|
|
144
|
+
element.type
|
|
145
|
+
} in '${ELEMENTS}' setting. Should be one of ${VALID_MODES.join(
|
|
144
146
|
",",
|
|
145
147
|
)}. Default value "${VALID_MODES[0]}" will be used instead`,
|
|
146
148
|
);
|
|
147
149
|
}
|
|
148
150
|
if (!element.pattern || !(isString(element.pattern) || isArray(element.pattern))) {
|
|
149
|
-
warnOnce(
|
|
151
|
+
warnOnce(
|
|
152
|
+
`Please provide a valid pattern to type ${element.type} in '${ELEMENTS}' setting`,
|
|
153
|
+
);
|
|
150
154
|
}
|
|
151
155
|
if (element.capture && !isArray(element.capture)) {
|
|
152
|
-
warnOnce(`Invalid capture property in '${ELEMENTS}' setting`);
|
|
156
|
+
warnOnce(`Invalid capture property of type ${element.type} in '${ELEMENTS}' setting`);
|
|
153
157
|
}
|
|
154
158
|
});
|
|
155
159
|
}
|