Skip to content

Commit f6df6f9

Browse files
renovate[bot]renovate-botota-meshi
authored
Update dependency @types/eslint to v8 (#115)
* Update dependency @types/eslint to v8 * update Co-authored-by: Renovate Bot <bot@renovateapp.com> Co-authored-by: Yosuke Ota <otameshiyo23@gmail.com>
1 parent 31dcbb3 commit f6df6f9

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
"@actions/core": "^1.2.6",
7070
"@ota-meshi/eslint-plugin": "^0.10.0",
7171
"@types/debug": "^4.1.5",
72-
"@types/eslint": "^7.2.0",
72+
"@types/eslint": "^8.0.0",
7373
"@types/eslint-scope": "^3.7.0",
7474
"@types/eslint-visitor-keys": "^1.0.0",
7575
"@types/estree": "^0.0.50",

tests/src/eslint-compat.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// @ts-check
22
import * as eslint from "eslint"
33

4+
type ESLintCLIEngine = any
5+
46
// eslint-disable-next-line @typescript-eslint/no-namespace -- ignore
57
export 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. */
1315
function 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

Comments
 (0)