From f0c6cfa44a7ea30bc4b419b65f028ec9c1436682 Mon Sep 17 00:00:00 2001 From: Andrew Gurden Date: Mon, 17 Apr 2023 17:16:11 +0100 Subject: [PATCH 1/2] fix: Correct file ignore check for node_modules on Windows --- src/eslint-adapter.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/eslint-adapter.ts b/src/eslint-adapter.ts index d29095af..f06ae0a7 100644 --- a/src/eslint-adapter.ts +++ b/src/eslint-adapter.ts @@ -146,7 +146,7 @@ export class ESLintAdapter { } public checkFileToBeIgnored(fileName: string) { - if (fileName.indexOf("node_modules" + path.sep) !== -1) return; + if (/node_modules[\\/]/.test(fileName)) return; if (!fileName.endsWith(".ts") && !fileName.endsWith(".tsx")) return; Promise.resolve() .then(() => new ESLint()) From fe0972c6393755e71fda75c1afcadba9376374f7 Mon Sep 17 00:00:00 2001 From: andyrooger <420834+andyrooger@users.noreply.github.com> Date: Fri, 28 Apr 2023 22:46:01 +0100 Subject: [PATCH 2/2] fix: Auto-ignore node_modules and non-ts files --- src/eslint-adapter.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/eslint-adapter.ts b/src/eslint-adapter.ts index f06ae0a7..6eed77e5 100644 --- a/src/eslint-adapter.ts +++ b/src/eslint-adapter.ts @@ -146,8 +146,10 @@ export class ESLintAdapter { } public checkFileToBeIgnored(fileName: string) { - if (/node_modules[\\/]/.test(fileName)) return; - if (!fileName.endsWith(".ts") && !fileName.endsWith(".tsx")) return; + if (/node_modules[\\/]/.test(fileName) || (!fileName.endsWith(".ts") && !fileName.endsWith(".tsx"))) { + this.ignoredFilepathMap.set(fileName, true); + return; + } Promise.resolve() .then(() => new ESLint()) .then(eslint => eslint.isPathIgnored(fileName))