mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-19 04:26:01 +08:00
build: ignore dist-schema for linting
This commit is contained in:
parent
b02a7e5f9b
commit
d69af5a663
@ -12,6 +12,12 @@ import * as path from 'path';
|
|||||||
import { Configuration, ILinterOptions, Linter, findFormatter } from 'tslint';
|
import { Configuration, ILinterOptions, Linter, findFormatter } from 'tslint';
|
||||||
import * as ts from 'typescript';
|
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) {
|
function _buildRules(logger: logging.Logger) {
|
||||||
const tsConfigPath = path.join(__dirname, '../rules/tsconfig.json');
|
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);
|
const tsLintConfig = Configuration.loadConfigurationFromPath(tsLintPath);
|
||||||
|
|
||||||
program.getRootFileNames().forEach(fileName => {
|
program.getRootFileNames().forEach(fileName => {
|
||||||
|
if (blacklist.some(x => x.test(path.relative(process.cwd(), fileName)))) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
linter.lint(fileName, ts.sys.readFile(fileName) || '', tsLintConfig);
|
linter.lint(fileName, ts.sys.readFile(fileName) || '', tsLintConfig);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user