diff --git a/lib/rules/no-path-concat.js b/lib/rules/no-path-concat.js index 69440af5..87ecae48 100644 --- a/lib/rules/no-path-concat.js +++ b/lib/rules/no-path-concat.js @@ -198,6 +198,7 @@ module.exports = { "Program:exit"(programNode) { const sourceCode = getSourceCode(context) const globalScope = + // @ts-ignore sourceCode.getScope?.(programNode) ?? context.getScope() const tracker = new ReferenceTracker(globalScope) /** @type {Set} */ diff --git a/lib/util/eslint-compat.js b/lib/util/eslint-compat.js index cbba37a4..a54af5f3 100644 --- a/lib/util/eslint-compat.js +++ b/lib/util/eslint-compat.js @@ -17,6 +17,7 @@ exports.getScope = function ( /** @type {Node} */ node ) { const sourceCode = exports.getSourceCode(context) + // @ts-ignore return sourceCode.getScope?.(node || sourceCode.ast) || context.getScope() } @@ -25,6 +26,7 @@ exports.getAncestors = function ( /** @type {Node} */ node ) { const sourceCode = exports.getSourceCode(context) + // @ts-ignore return sourceCode.getAncestors?.(node) || context.getAncestors() } diff --git a/package.json b/package.json index daf99eaa..1a68bd27 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "@types/node": "^20.17.5", "@typescript-eslint/parser": "^8.26.1", "@typescript-eslint/typescript-estree": "^8.26.1", - "eslint": "^9.14.0", + "eslint": "^9.31.0", "eslint-config-prettier": "^9.1.0", "eslint-doc-generator": "^1.7.1", "eslint-plugin-eslint-plugin": "^6.3.1",