From 59c7f508705685fa619268f10fa547dffeb6626f Mon Sep 17 00:00:00 2001 From: Benjamin Lichtman Date: Tue, 19 Mar 2019 16:19:39 -0700 Subject: [PATCH] fix(typescript-estree): only call watch callback on new files --- .eslintrc.json | 3 ++- packages/typescript-estree/src/tsconfig-parser.ts | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index e3abc256901a..818b90dfab53 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 c136c518c2d6..135bbdfbc04e 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; } pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy