1
0
mirror of https://github.com/angular/angular-cli.git synced 2025-05-18 20:02:40 +08:00

build: ignore dist-schema for linting

This commit is contained in:
Hans 2018-09-19 10:27:58 -07:00
parent b02a7e5f9b
commit d69af5a663

@ -12,6 +12,12 @@ import * as path from 'path';
import { Configuration, ILinterOptions, Linter, findFormatter } from 'tslint';
import * as ts from 'typescript';
// Blacklist (regexes) of the files to not lint. Generated files should not be linted.
// TODO: when moved to using bazel for the build system, this won't be needed.
const blacklist = [
/^dist-schema[\\\/].*/,
];
function _buildRules(logger: logging.Logger) {
const tsConfigPath = path.join(__dirname, '../rules/tsconfig.json');
@ -50,6 +56,10 @@ export default function (options: ParsedArgs, logger: logging.Logger) {
const tsLintConfig = Configuration.loadConfigurationFromPath(tsLintPath);
program.getRootFileNames().forEach(fileName => {
if (blacklist.some(x => x.test(path.relative(process.cwd(), fileName)))) {
return;
}
linter.lint(fileName, ts.sys.readFile(fileName) || '', tsLintConfig);
});