File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -12,11 +12,14 @@ function createIsIgnored(
12
12
ignored : WatchFileSystemOptions [ 'ignored' ] | undefined
13
13
) : ( path : string ) => boolean {
14
14
const ignoredPatterns = ignored ? ( Array . isArray ( ignored ) ? ignored : [ ignored ] ) : [ ] ;
15
- const ignoredFunctions = ignoredPatterns . map ( ( pattern ) =>
16
- pattern instanceof RegExp
17
- ? ( path : string ) => pattern . test ( path )
18
- : ( path : string ) => minimatch ( path , pattern )
19
- ) ;
15
+ const ignoredFunctions = ignoredPatterns
16
+ // sanitize patterns - see https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/issues/594
17
+ . filter ( ( pattern ) => typeof pattern === 'string' || pattern instanceof RegExp )
18
+ . map ( ( pattern ) =>
19
+ pattern instanceof RegExp
20
+ ? ( path : string ) => pattern . test ( path )
21
+ : ( path : string ) => minimatch ( path , pattern )
22
+ ) ;
20
23
ignoredFunctions . push ( ( path : string ) =>
21
24
BUILTIN_IGNORED_DIRS . some ( ( ignoredDir ) => path . includes ( `/${ ignoredDir } /` ) )
22
25
) ;
You can’t perform that action at this time.
0 commit comments