Skip to content

Commit 4581521

Browse files
committed
fix(ci) lock down [email protected] to fix test:types
[email protected] removed some of the RuleContext types (see eslint/eslint#19910), causing the `test:types` CI script to fail. Since eslint-plugin-n still needs to support 8.x versions of eslint, the implementation that relies on RuleContexts can't be removed. A simple solution to unblock the CI is to annotate the few places that rely on them with @ts-ignore. When eslint 8.x support is dropped, these annotations should be removed. That, in turn, will expose the code that relies on eslint 8.x APIs, which should then also be removed. As part of this PR, the eslint dependency was bumped to ^9.31.0. This was done in order to prevent developers from developing locally with older 9.x versions of eslint and accidentally introducing new code that relies of these types with properly handling the type annotations and having it fail in the CI. Fixes #459
1 parent 8185617 commit 4581521

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

lib/rules/no-path-concat.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ module.exports = {
198198
"Program:exit"(programNode) {
199199
const sourceCode = getSourceCode(context)
200200
const globalScope =
201+
// @ts-ignore
201202
sourceCode.getScope?.(programNode) ?? context.getScope()
202203
const tracker = new ReferenceTracker(globalScope)
203204
/** @type {Set<import('estree').Node>} */

lib/util/eslint-compat.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ exports.getScope = function (
1717
/** @type {Node} */ node
1818
) {
1919
const sourceCode = exports.getSourceCode(context)
20+
// @ts-ignore
2021
return sourceCode.getScope?.(node || sourceCode.ast) || context.getScope()
2122
}
2223

@@ -25,6 +26,7 @@ exports.getAncestors = function (
2526
/** @type {Node} */ node
2627
) {
2728
const sourceCode = exports.getSourceCode(context)
29+
// @ts-ignore
2830
return sourceCode.getAncestors?.(node) || context.getAncestors()
2931
}
3032

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"@types/node": "^20.17.5",
3535
"@typescript-eslint/parser": "^8.26.1",
3636
"@typescript-eslint/typescript-estree": "^8.26.1",
37-
"eslint": "^9.14.0",
37+
"eslint": "^9.31.0",
3838
"eslint-config-prettier": "^9.1.0",
3939
"eslint-doc-generator": "^1.7.1",
4040
"eslint-plugin-eslint-plugin": "^6.3.1",

0 commit comments

Comments
 (0)