1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
import * as ts from "typescript";
import { findConfiguration, findConfigurationPath, getRulesDirectories, IConfigurationFile, loadConfigurationFromPath } from "./configuration";
import { ILinterOptions, LintResult } from "./index";
import { RuleFailure } from "./language/rule/rule";
/**
* Linter that can lint multiple files in consecutive runs.
*/
declare class Linter {
private options;
private program;
static VERSION: string;
static findConfiguration: typeof findConfiguration;
static findConfigurationPath: typeof findConfigurationPath;
static getRulesDirectories: typeof getRulesDirectories;
static loadConfigurationFromPath: typeof loadConfigurationFromPath;
private failures;
private fixes;
/**
* Creates a TypeScript program object from a tsconfig.json file path and optional project directory.
*/
static createProgram(configFile: string, projectDirectory?: string): ts.Program;
/**
* Returns a list of source file names from a TypeScript program. This includes all referenced
* files and excludes declaration (".d.ts") files.
*/
static getFileNames(program: ts.Program): string[];
constructor(options: ILinterOptions, program?: ts.Program | undefined);
lint(fileName: string, source: string, configuration?: IConfigurationFile): void;
getResult(): LintResult;
private getAllFailures(sourceFile, enabledRules);
private applyAllFixes(enabledRules, fileFailures, sourceFile, sourceFileName);
protected applyFixes(sourceFilePath: string, source: string, fixableFailures: RuleFailure[]): string;
private updateProgram(sourceFilePath);
private applyRule(rule, sourceFile);
private getEnabledRules(configuration, isJs);
private getSourceFile(fileName, source);
}
declare namespace Linter {
}
export = Linter;
|