From 4eb6e5d3e19663b0d63551713939fc4a015a9bc0 Mon Sep 17 00:00:00 2001 From: Christopher Hiller Date: Fri, 25 Aug 2023 10:26:04 -0700 Subject: [PATCH] fix(rules): no-banned-files ignores node_modules Closes #330 --- src/rules/builtin/no-banned-files.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/rules/builtin/no-banned-files.ts b/src/rules/builtin/no-banned-files.ts index 1075b0e79..d8f598343 100644 --- a/src/rules/builtin/no-banned-files.ts +++ b/src/rules/builtin/no-banned-files.ts @@ -91,6 +91,9 @@ const noBannedFiles = createRule({ const dirents = await fs.readdir(dir, {withFileTypes: true}); for (const dirent of dirents) { if (dirent.isDirectory()) { + if (path.basename(dirent.name) === 'node_modules') { + continue; + } queue.push(path.join(dir, dirent.name)); } else { if (allow.has(dirent.name)) {