X Tutup
The Wayback Machine - https://web.archive.org/web/20201023163952/https://github.com/angular/angular-cli/pull/17645/files
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(@angular/cli): add option to enable parallel linting operations #17645

Open
wants to merge 1 commit into
base: master
from
Open
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -74,3 +74,12 @@ ng lint [project]
Output format (prose, json, stylish, verbose, pmd, msbuild, checkstyle, vso, fileslist, codeFrame).
</p>
</details>
<details>
<summary>parallel</summary>
<p>
<code>--parallel</code>
</p>
<p>
Run multiple lint operations in parallel.
</p>
</details>
@@ -79,6 +79,11 @@
"items": {
"type": "string"
}
},
"parallel": {
"type": "boolean",
"description": "Run multiple lint operations in parallel.",
"default": false
}
},
"additionalProperties": false,
@@ -59,9 +59,15 @@ export default async function(options: ParsedArgs, logger: logging.Logger) {
oldWarn(...args);
};

program.getRootFileNames().forEach(fileName => {
linter.lint(fileName, ts.sys.readFile(fileName) || '', tsLintConfig);
});
const rootFileNames = program.getRootFileNames();

if (options.parallel) {
await Promise.all(rootFileNames.map((fileName) => linter.lint(fileName, ts.sys.readFile(fileName) || '', tsLintConfig)));
} else {
rootFileNames.forEach(fileName => {
linter.lint(fileName, ts.sys.readFile(fileName) || '', tsLintConfig);
});
}

console.warn = oldWarn;

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.
X Tutup