Skip to content

Commit

Permalink
fix: process less files in parallel preventing OOM errors (#369)
Browse files Browse the repository at this point in the history
  • Loading branch information
bcoe authored and JustinBeckwith committed Jul 30, 2019
1 parent 3f0c593 commit b48196d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/lint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,19 +74,19 @@ export function lint(
: path.resolve(options.gtsRootDir, 'tslint.json');

const configuration = Configuration.loadConfigurationFromPath(configPath);
const linter = new Linter({ fix, formatter: 'codeFrame' }, program);

files.forEach(file => {
for (const file of files) {
const sourceFile = program.getSourceFile(file);
if (sourceFile) {
const fileContents = sourceFile.getFullText();
const linter = new Linter({ fix, formatter: 'codeFrame' }, program);
linter.lint(file, fileContents, configuration);
const result = linter.getResult();
if (result.errorCount || result.warningCount) {
options.logger.log(result.output);
return false;
}
}
});
const result = linter.getResult();
if (result.errorCount || result.warningCount) {
options.logger.log(result.output);
return false;
}
return true;
}
Expand Down

0 comments on commit b48196d

Please sign in to comment.