@@ -77,9 +77,11 @@ module.exports = {
77
77
const restrictedPaths = options . zones || [ ] ;
78
78
const basePath = options . basePath || process . cwd ( ) ;
79
79
const currentFilename = context . getPhysicalFilename ? context . getPhysicalFilename ( ) : context . getFilename ( ) ;
80
- const matchingZones = restrictedPaths . filter ( ( zone ) => [ ] . concat ( zone . target )
81
- . map ( ( target ) => path . resolve ( basePath , target ) )
82
- . some ( ( targetPath ) => isMatchingTargetPath ( currentFilename , targetPath ) ) ) ;
80
+ const matchingZones = restrictedPaths . filter (
81
+ ( zone ) => [ ] . concat ( zone . target )
82
+ . map ( ( target ) => path . resolve ( basePath , target ) )
83
+ . some ( ( targetPath ) => isMatchingTargetPath ( currentFilename , targetPath ) ) ,
84
+ ) ;
83
85
84
86
function isMatchingTargetPath ( filename , targetPath ) {
85
87
if ( isGlob ( targetPath ) ) {
@@ -231,8 +233,7 @@ module.exports = {
231
233
reportInvalidExceptions ( validatorsWithInvalidExceptions , node ) ;
232
234
233
235
const applicableValidatorsForImportPathExcludingExceptions = applicableValidatorsForImportPath
234
- . filter ( ( validator ) => validator . hasValidExceptions )
235
- . filter ( ( validator ) => ! validator . isPathException ( absoluteImportPath ) ) ;
236
+ . filter ( ( validator ) => validator . hasValidExceptions && ! validator . isPathException ( absoluteImportPath ) ) ;
236
237
reportImportsInRestrictedZone ( applicableValidatorsForImportPathExcludingExceptions , node , importPath , zone . message ) ;
237
238
} ) ;
238
239
}
0 commit comments