diff --git a/src/eslint-adapter.ts b/src/eslint-adapter.ts index d29095af..6eed77e5 100644 --- a/src/eslint-adapter.ts +++ b/src/eslint-adapter.ts @@ -146,8 +146,10 @@ export class ESLintAdapter { } public checkFileToBeIgnored(fileName: string) { - if (fileName.indexOf("node_modules" + path.sep) !== -1) 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))