diff --git a/scripts/lint.ts b/scripts/lint.ts index d213461005..1b7339385b 100644 --- a/scripts/lint.ts +++ b/scripts/lint.ts @@ -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); });