From bc69bf830e231c8edaadf219ab176d0ea5c3ec2b Mon Sep 17 00:00:00 2001 From: Henric Trotzig Date: Sat, 28 May 2016 22:26:54 +0200 Subject: [PATCH] Fix ignoring node_modules in findMatchingFilesWithNode The previous ignore pattern didn't work. Due to how we use a temp folder as the lookup path in our findMatchingFiles test, it's tricky to add a test for ignoring the node_modules folder. There's room for improvement: - we need a test - we should probably ignore nested node_modules folders as well If I have time, I'll come back to this soon to make it more robust. --- lib/findMatchingFiles.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/findMatchingFiles.js b/lib/findMatchingFiles.js index a8d33acc..267cf4f8 100644 --- a/lib/findMatchingFiles.js +++ b/lib/findMatchingFiles.js @@ -39,8 +39,9 @@ function findMatchingFilesWithNode( validFilesRegex: string ): Array { return glob.sync(`${lookupPath}/**/*.js*`, { - ignore: './node_modules/*', - }).filter((filePath: string): bool => new RegExp(validFilesRegex, 'i').test(filePath)); + ignore: './node_modules/**/*', + }).filter((filePath: string): bool => + new RegExp(validFilesRegex, 'i').test(filePath)); } /**