mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
fix(eslint): missing static method/property on CLIEngine (#43345)
* fix(eslint): missing static method/property - change `CLIEngine.version` to static property - add `CLIEngine.getFormatter` static method * fix(eslint): change let to const in tests * refactor(eslint): revert formatting
This commit is contained in:
parent
5adeca0533
commit
e26aaaedb2
@ -547,8 +547,13 @@ data = {rulesMeta: {"no-extra-semi": meta}};
|
||||
formatter(cliReport.results);
|
||||
formatter(cliReport.results, data);
|
||||
|
||||
const version: string = CLIEngine.version;
|
||||
|
||||
CLIEngine.getErrorResults(cliReport.results);
|
||||
|
||||
formatter = CLIEngine.getFormatter();
|
||||
formatter = CLIEngine.getFormatter('codeframe');
|
||||
|
||||
CLIEngine.outputFixes(cliReport);
|
||||
|
||||
cliReport.errorCount = 0;
|
||||
|
||||
4
types/eslint/index.d.ts
vendored
4
types/eslint/index.d.ts
vendored
@ -474,7 +474,7 @@ export namespace Linter {
|
||||
//#region CLIEngine
|
||||
|
||||
export class CLIEngine {
|
||||
version: string;
|
||||
static version: string;
|
||||
|
||||
constructor(options: CLIEngine.Options);
|
||||
|
||||
@ -496,6 +496,8 @@ export class CLIEngine {
|
||||
|
||||
static getErrorResults(results: CLIEngine.LintResult[]): CLIEngine.LintResult[];
|
||||
|
||||
static getFormatter(format?: string): CLIEngine.Formatter;
|
||||
|
||||
static outputFixes(report: CLIEngine.LintReport): void;
|
||||
}
|
||||
|
||||
|
||||
@ -547,8 +547,13 @@ data = {rulesMeta: {"no-extra-semi": meta}};
|
||||
formatter(cliReport.results);
|
||||
formatter(cliReport.results, data);
|
||||
|
||||
const version: string = CLIEngine.version;
|
||||
|
||||
CLIEngine.getErrorResults(cliReport.results);
|
||||
|
||||
formatter = CLIEngine.getFormatter();
|
||||
formatter = CLIEngine.getFormatter('codeframe');
|
||||
|
||||
CLIEngine.outputFixes(cliReport);
|
||||
|
||||
cliReport.errorCount = 0;
|
||||
|
||||
4
types/eslint/ts3.1/index.d.ts
vendored
4
types/eslint/ts3.1/index.d.ts
vendored
@ -470,7 +470,7 @@ export namespace Linter {
|
||||
//#region CLIEngine
|
||||
|
||||
export class CLIEngine {
|
||||
version: string;
|
||||
static version: string;
|
||||
|
||||
constructor(options: CLIEngine.Options);
|
||||
|
||||
@ -492,6 +492,8 @@ export class CLIEngine {
|
||||
|
||||
static getErrorResults(results: CLIEngine.LintResult[]): CLIEngine.LintResult[];
|
||||
|
||||
static getFormatter(format?: string): CLIEngine.Formatter;
|
||||
|
||||
static outputFixes(report: CLIEngine.LintReport): void;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user