diff --git a/src/dev/tslint/run_tslint_cli.ts b/src/dev/tslint/run_tslint_cli.ts index c7e7fa8009f7e..436cb1f187bd5 100644 --- a/src/dev/tslint/run_tslint_cli.ts +++ b/src/dev/tslint/run_tslint_cli.ts @@ -31,7 +31,11 @@ class LintFailure { constructor(public project: Project, public error: execa.ExecaError) {} } -export function runTslintCli() { +export function runTslintCliOnTsConfigPaths(tsConfigPaths: string[]) { + runTslintCli(tsConfigPaths.map(tsConfigPath => new Project(tsConfigPath))); +} + +export function runTslintCli(projects = PROJECTS) { const log = createToolingLog('info'); log.pipe(process.stdout); @@ -42,23 +46,25 @@ export function runTslintCli() { } const list = new Listr( - PROJECTS.filter(project => { - if (!opts.project) { - return true; - } + projects + .filter(project => { + if (!opts.project) { + return true; + } - return resolve(opts.project) === project.tsConfigPath; - }).map(project => ({ - task: () => - execa('tslint', [...process.argv.slice(2), '--project', project.tsConfigPath], { - cwd: project.directory, - env: chalk.enabled ? { FORCE_COLOR: 'true' } : {}, - stdio: ['ignore', 'pipe', 'pipe'], - }).catch(error => { - throw new LintFailure(project, error); - }), - title: project.name, - })), + return resolve(opts.project) === project.tsConfigPath; + }) + .map(project => ({ + task: () => + execa('tslint', [...process.argv.slice(2), '--project', project.tsConfigPath], { + cwd: project.directory, + env: chalk.enabled ? { FORCE_COLOR: 'true' } : {}, + stdio: ['ignore', 'pipe', 'pipe'], + }).catch(error => { + throw new LintFailure(project, error); + }), + title: project.name, + })), { concurrent: true, exitOnError: false,