+ // Handle patterns too, either as strings or groups
+ const restrictedPatterns = (isPathAndPatternsObject ? options[0].patterns : []) || [];
+ const restrictedPatternGroups = restrictedPatterns.length > 0 && typeof restrictedPatterns[0] === "string"
+ ? [{ matcher: ignore().add(restrictedPatterns) }]
+ : restrictedPatterns.map(({ group, message }) => ({ matcher: ignore().add(group), customMessage: message }));
+
+ // if no imports are restricted we don"t need to check
+ if (Object.keys(restrictedPaths).length === 0 && restrictedPatternGroups.length === 0) {
+ return {};
+ }