From 975ed9cb171767f0720d31a9d7c151dad53785b3 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Tue, 24 May 2016 13:57:12 -0700 Subject: [PATCH] Avoid linting files twice --- Jakefile.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Jakefile.js b/Jakefile.js index 6c7724116ad..55113f986bc 100644 --- a/Jakefile.js +++ b/Jakefile.js @@ -981,19 +981,22 @@ var lintTargets = compilerSources .concat(tslintRulesFiles) .concat(servicesLintTargets); + desc("Runs tslint on the compiler sources. Optional arguments are: f[iles]=regex"); task("lint", ["build-rules"], function() { var lintOptions = getLinterOptions(); var failed = 0; var fileMatcher = RegExp(process.env.f || process.env.file || process.env.files || ""); + var done = {}; for (var i in lintTargets) { var target = lintTargets[i]; - if (fileMatcher.test(target)) { + if (!done[target] && fileMatcher.test(target)) { var result = lintFile(lintOptions, target); if (result.failureCount > 0) { console.log(result.output); failed += result.failureCount; } + done[target] = true; } } if (failed > 0) {