UNPKG

1.57 kBTypeScriptView Raw
1import { Linter, LintResult, RuleFailure } from 'tslint';
2import { Diagnostic, Program } from 'typescript';
3import { LinterOptions } from './lint-factory';
4import { BuildContext } from '../util/interfaces';
5/**
6 * Lint files
7 * @param {BuildContext} context
8 * @param {Program} program
9 * @param {string} tsLintConfig - TSLint config file path
10 * @param {Array<string>} filePaths
11 * @param {LinterOptions} linterOptions
12 */
13export declare function lintFiles(context: BuildContext, program: Program, tsLintConfig: string, filePaths: string[], linterOptions?: LinterOptions): Promise<void>;
14export declare function lintFile(linter: Linter, config: any, filePath: string): Promise<void>;
15/**
16 * Process typescript diagnostics after type checking
17 * NOTE: This will throw a BuildError if there were any type errors.
18 * @param {BuildContext} context
19 * @param {Array<Diagnostic>} tsDiagnostics
20 */
21export declare function processTypeCheckDiagnostics(context: BuildContext, tsDiagnostics: Diagnostic[]): void;
22/**
23 * Process lint results
24 * NOTE: This will throw a BuildError if there were any warnings or errors in any of the lint results.
25 * @param {BuildContext} context
26 * @param {LintResult} result
27 */
28export declare function processLintResult(context: BuildContext, result: LintResult): void;
29export declare function generateErrorMessageForFiles(failingFiles: string[], message?: string): string;
30export declare function getFileNames(context: BuildContext, failures: RuleFailure[]): string[];
31export declare function removeDuplicateFileNames(fileNames: string[]): string[];