From 3dde906d1872b5d3942d380287f4fc71e65be1fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Ole=C5=9B?= Date: Sun, 21 May 2017 22:34:08 +0200 Subject: [PATCH] Handle deleted files --- lib/IncrementalChecker.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/IncrementalChecker.js b/lib/IncrementalChecker.js index 73eb8e7c..853bf86c 100644 --- a/lib/IncrementalChecker.js +++ b/lib/IncrementalChecker.js @@ -150,7 +150,14 @@ IncrementalChecker.prototype.getLints = function (cancellationToken) { workSet.forEach(function (fileName) { cancellationToken.throwIfCancellationRequested(); - this.linter.lint(fileName, undefined, this.linterConfig); + try { + this.linter.lint(fileName, undefined, this.linterConfig); + } catch (e) { + if (fs.existsSync(fileName)) { + // it's not because file doesn't exist - throw error + throw e; + } + } }.bind(this)); // set lints in files register