@@ -77,9 +77,11 @@ module.exports = {
7777 const restrictedPaths = options . zones || [ ] ;
7878 const basePath = options . basePath || process . cwd ( ) ;
7979 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+ ) ;
8385
8486 function isMatchingTargetPath ( filename , targetPath ) {
8587 if ( isGlob ( targetPath ) ) {
@@ -231,8 +233,7 @@ module.exports = {
231233 reportInvalidExceptions ( validatorsWithInvalidExceptions , node ) ;
232234
233235 const applicableValidatorsForImportPathExcludingExceptions = applicableValidatorsForImportPath
234- . filter ( ( validator ) => validator . hasValidExceptions )
235- . filter ( ( validator ) => ! validator . isPathException ( absoluteImportPath ) ) ;
236+ . filter ( ( validator ) => validator . hasValidExceptions && ! validator . isPathException ( absoluteImportPath ) ) ;
236237 reportImportsInRestrictedZone ( applicableValidatorsForImportPathExcludingExceptions , node , importPath , zone . message ) ;
237238 } ) ;
238239 }
0 commit comments