1 | import * as ts from 'typescript';
|
2 | import { Finding, EffectiveConfiguration, LintAndFixFileResult, Severity, MessageHandler, AbstractProcessor, DeprecationHandler, FindingFilterFactory } from '@fimbul/ymir';
|
3 | import { RuleLoader } from './services/rule-loader';
|
4 | export interface LinterOptions {
|
5 | reportUselessDirectives?: Severity;
|
6 | }
|
7 |
|
8 | export interface ProgramFactory {
|
9 |
|
10 | getCompilerOptions(): ts.CompilerOptions;
|
11 |
|
12 | getProgram(): ts.Program;
|
13 | }
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 | export declare type UpdateFileCallback = (content: string, range: ts.TextChangeRange) => ts.SourceFile | undefined;
|
20 | export declare class Linter {
|
21 | private ruleLoader;
|
22 | private logger;
|
23 | private deprecationHandler;
|
24 | private filterFactory;
|
25 | constructor(ruleLoader: RuleLoader, logger: MessageHandler, deprecationHandler: DeprecationHandler, filterFactory: FindingFilterFactory);
|
26 | lintFile(file: ts.SourceFile, config: EffectiveConfiguration, programOrFactory?: ProgramFactory | ts.Program, options?: LinterOptions): ReadonlyArray<Finding>;
|
27 | lintAndFix(file: ts.SourceFile, content: string, config: EffectiveConfiguration, updateFile: UpdateFileCallback, iterations?: number, programFactory?: ProgramFactory, processor?: AbstractProcessor, options?: LinterOptions,
|
28 |
|
29 | findings?: readonly Finding[]): LintAndFixFileResult;
|
30 | private prepareRules;
|
31 | private applyRules;
|
32 | }
|