import-js / eslint-plugin-import

ESLint plugin with rules that help validate proper imports.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

'TypeError: context.getAncestors is not a function' with ESLint v9

vpmedia opened this issue · comments

After upgrading to ESLint v9 I'm getting the following exception:

TypeError: context.getAncestors is not a function
Occurred while linting PROJECT_DIR/eslint.config.js:1
Rule: "import/no-named-as-default"
    at importDeclaration (PROJECT_DIR/node_modules/eslint-plugin-import/lib/importDeclaration.js:2:27)
    at checkDefault (PROJECT_DIR/node_modules/eslint-plugin-import/lib/rules/no-named-as-default.js:21:62)
    at ruleErrorHandler (PROJECT_DIR/node_modules/eslint/lib/linter/linter.js:1145:48)
    at PROJECT_DIR/node_modules/eslint/lib/linter/safe-emitter.js:45:58
    at Array.forEach (<anonymous>)
    at Object.emit (PROJECT_DIR/node_modules/eslint/lib/linter/safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (PROJECT_DIR/node_modules/eslint/lib/linter/node-event-generator.js:297:26)
    at NodeEventGenerator.applySelectors (PROJECT_DIR/node_modules/eslint/lib/linter/node-event-generator.js:326:22)
    at NodeEventGenerator.enterNode (PROJECT_DIR/node_modules/eslint/lib/linter/node-event-generator.js:340:14)
    at runRules (PROJECT_DIR/node_modules/eslint/lib/linter/linter.js:1184:40)

"eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8"

Compatibility issue: #2948

is it package will upgrade or no?

Just like with every eslint major, you basically always have to wait weeks or months to upgrade to it, until all the plugins and configs you depend on have had a chance to do so.

Closing as a duplicate of #2948. Thanks for the stack trace - that will help the effort to add compatibility.