Avoid linting files twice

This commit is contained in:
Nathan Shively-Sanders
2016-05-24 13:57:12 -07:00
parent 9865b48d0f
commit 975ed9cb17

View File

@@ -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) {