11// @ts -check
22import * as eslint from "eslint"
33
4+ type ESLintCLIEngine = any
5+
46// eslint-disable-next-line @typescript-eslint/no-namespace -- ignore
57export namespace ESLint {
68 export type LintResult = eslint . ESLint . LintResult
@@ -12,9 +14,9 @@ export const ESLint = eslint.ESLint || getESLintClassForV6()
1214/** Build the ESLint class that ESLint v6 compatible. */
1315function getESLintClassForV6 ( ) : typeof eslint . ESLint {
1416 // eslint-disable-next-line @typescript-eslint/naming-convention -- ignore
15- const CLIEngine = eslint . CLIEngine
17+ const CLIEngine = ( eslint as any ) . CLIEngine
1618 class ESLintForV6 {
17- private readonly engine : eslint . CLIEngine
19+ private readonly engine : ESLintCLIEngine
1820
1921 public static get version ( ) {
2022 return CLIEngine . version
@@ -37,7 +39,7 @@ function getESLintClassForV6(): typeof eslint.ESLint {
3739 plugins : pluginsMap ,
3840 ...otherOptions
3941 } = options || { }
40- const newOptions : eslint . CLIEngine . Options = {
42+ const newOptions : ESLintCLIEngine [ " Options" ] = {
4143 fix : Boolean ( fix ) ,
4244 reportUnusedDisableDirectives : reportUnusedDisableDirectives
4345 ? reportUnusedDisableDirectives !== "off"
@@ -54,7 +56,7 @@ function getESLintClassForV6(): typeof eslint.ESLint {
5456 o [ ruleId ] = opt
5557 }
5658 return o
57- } , { } as NonNullable < eslint . CLIEngine . Options [ "rules" ] > )
59+ } , { } as NonNullable < ESLintCLIEngine [ " Options" ] [ "rules" ] > )
5860 : undefined ,
5961 ...overrideConfig ,
6062 }
0 commit comments