diff --git a/.eslintrc.json b/.eslintrc.json index e3abc256901..818b90dfab5 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -25,7 +25,8 @@ "sourceType": "module", "ecmaFeatures": { "jsx": false - } + }, + "project": "./tsconfig.base.json" }, "overrides": [ { diff --git a/packages/typescript-estree/src/tsconfig-parser.ts b/packages/typescript-estree/src/tsconfig-parser.ts index c136c518c2d..135bbdfbc04 100644 --- a/packages/typescript-estree/src/tsconfig-parser.ts +++ b/packages/typescript-estree/src/tsconfig-parser.ts @@ -28,6 +28,8 @@ const knownWatchProgramMap = new Map< */ const watchCallbackTrackingMap = new Map(); +const parsedFilesSeen = new Set(); + /** * Holds information about the file currently being linted */ @@ -71,7 +73,7 @@ export function calculateProjectParserOptions( // Update file version if necessary // TODO: only update when necessary, currently marks as changed on every lint const watchCallback = watchCallbackTrackingMap.get(filePath); - if (typeof watchCallback !== 'undefined') { + if (parsedFilesSeen.has(filePath) && typeof watchCallback !== 'undefined') { watchCallback(filePath, ts.FileWatcherEventKind.Changed); } @@ -174,6 +176,7 @@ export function calculateProjectParserOptions( results.push(program); } + parsedFilesSeen.add(filePath); return results; }