diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-05-28 00:38:50 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-05-28 00:40:43 +0200 |
commit | 7fff4499fd915bcea3fa93b1aa8b35f4fe7a6027 (patch) | |
tree | 6de9a1aebd150a23b7f8c273ec657a5d0a18fe3e /node_modules/tslint/lib/linter.d.ts | |
parent | 963b7a41feb29cc4be090a2446bdfe0c1f1bcd81 (diff) |
add linting (and some initial fixes)
Diffstat (limited to 'node_modules/tslint/lib/linter.d.ts')
-rw-r--r-- | node_modules/tslint/lib/linter.d.ts | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/node_modules/tslint/lib/linter.d.ts b/node_modules/tslint/lib/linter.d.ts new file mode 100644 index 000000000..0d1d4b664 --- /dev/null +++ b/node_modules/tslint/lib/linter.d.ts @@ -0,0 +1,39 @@ +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); + 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 applyRule(rule, sourceFile); + private getEnabledRules(configuration, isJs); + private getSourceFile(fileName, source); +} +declare namespace Linter { +} +export = Linter; |