1 | import eslint = require("eslint");
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | export const getErrorResults: typeof eslint.ESLint.getErrorResults;
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 | export function getFormatter(
|
17 | format?: string,
|
18 | ): (results: eslint.ESLint.LintResult[], data?: eslint.ESLint.LintResultData) => string;
|
19 |
|
20 |
|
21 |
|
22 |
|
23 | export function outputFixes(report: ResultReport): void;
|
24 |
|
25 | export function getConfig(
|
26 | options: CLIEngineOptions & { filePath: string },
|
27 | ): ReturnType<eslint.ESLint["calculateConfigForFile"]>;
|
28 | export function lintText(text: string, options?: Options): ResultReport;
|
29 | export function lintFiles(patterns: string | string[], options?: Options): ResultReport | Promise<ResultReport>;
|
30 |
|
31 | export type CLIEngineOptions = Pick<eslint.ESLint.Options, "baseConfig" | "cwd" | "extensions" | "fix" | "ignore"> & {
|
32 | envs?: string[] | undefined;
|
33 | globals?: string[] | undefined;
|
34 | parser?: string | undefined;
|
35 | plugins?: string[];
|
36 | rules?: { [name: string]: eslint.Linter.RuleLevel | eslint.Linter.RuleLevelAndOptions } | undefined;
|
37 | };
|
38 | export type ESLintOptions = Pick<eslint.Linter.LintOptions, "filename">;
|
39 | export type ESLintConfig = Pick<eslint.Linter.Config, "extends" | "settings">;
|
40 |
|
41 | export type Options =
|
42 | & {
|
43 |
|
44 | ignores?: string[] | undefined;
|
45 |
|
46 | nodeVersion?: string | boolean | undefined;
|
47 |
|
48 | prettier?: boolean | undefined;
|
49 | |
50 |
|
51 |
|
52 | printConfig?: string | undefined;
|
53 |
|
54 | semicolon?: boolean | undefined;
|
55 |
|
56 | space?: boolean | number | undefined;
|
57 | |
58 |
|
59 |
|
60 |
|
61 |
|
62 |
|
63 | webpack?: boolean | object | undefined;
|
64 | }
|
65 | & CLIEngineOptions
|
66 | & ESLintConfig
|
67 | & ESLintOptions;
|
68 |
|
69 | export interface ResultReport {
|
70 | readonly errorCount: number;
|
71 | readonly warningCount: number;
|
72 | readonly results: eslint.ESLint.LintResult[];
|
73 | }
|