Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: context.getScope is not a function (ESLint 9 compatibility issues) #589

Closed
robinloeffel opened this issue Dec 18, 2024 · 2 comments · Fixed by #596
Closed

TypeError: context.getScope is not a function (ESLint 9 compatibility issues) #589

robinloeffel opened this issue Dec 18, 2024 · 2 comments · Fixed by #596

Comments

@robinloeffel
Copy link

When using some of the plugins' rules directly, without going via one of the provided flat configs that wrap around @eslint/compat, you will sooner or later run into the following error:

Oops! Something went wrong! :(

ESLint: 9.17.0

TypeError: context.getScope is not a function
Occurred while linting /Users/robin/Sites/portfolio/src/ts/email.ts:4
Rule: "github/async-preventdefault"
    at CallExpression (/Users/robin/Sites/portfolio/node_modules/eslint-plugin-github/lib/rules/async-preventdefault.js:20:33)
    at ruleErrorHandler (/Users/robin/Sites/portfolio/node_modules/eslint/lib/linter/linter.js:1098:48)
    at /Users/robin/Sites/portfolio/node_modules/eslint/lib/linter/safe-emitter.js:45:58
    at Array.forEach (<anonymous>)
    at Object.emit (/Users/robin/Sites/portfolio/node_modules/eslint/lib/linter/safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (/Users/robin/Sites/portfolio/node_modules/eslint/lib/linter/node-event-generator.js:297:26)
    at NodeEventGenerator.applySelectors (/Users/robin/Sites/portfolio/node_modules/eslint/lib/linter/node-event-generator.js:326:22)
    at NodeEventGenerator.enterNode (/Users/robin/Sites/portfolio/node_modules/eslint/lib/linter/node-event-generator.js:337:14)
    at runRules (/Users/robin/Sites/portfolio/node_modules/eslint/lib/linter/linter.js:1142:40)
    at #flatVerifyWithoutProcessors (/Users/robin/Sites/portfolio/node_modules/eslint/lib/linter/linter.js:1911:31)

Please update the plugin according to ESLint's guide.

@silverwind
Copy link

Ran into this as well trying to make the plugin work in a flat config. Different stack trace, same error:

TypeError: context.getScope is not a function
Occurred while linting tests/e2e/example.test.e2e.ts:5
Rule: "github/async-currenttarget"
    at AwaitExpression (node_modules/eslint-plugin-github/lib/rules/async-currenttarget.js:16:34)
    at ruleErrorHandler (node_modules/eslint/lib/linter/linter.js:1098:48)
    at node_modules/eslint/lib/linter/safe-emitter.js:45:58
    at Array.forEach (<anonymous>)
    at Object.emit (node_modules/eslint/lib/linter/safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (node_modules/eslint/lib/linter/node-event-generator.js:297:26)
    at NodeEventGenerator.applySelectors (node_modules/eslint/lib/linter/node-event-generator.js:326:22)
    at NodeEventGenerator.enterNode (node_modules/eslint/lib/linter/node-event-generator.js:337:14)
    at runRules (node_modules/eslint/lib/linter/linter.js:1142:40)
    at #flatVerifyWithoutProcessors (node_modules/eslint/lib/linter/linter.js:1911:31)

@gracepark
Copy link
Contributor

Hi all! Thanks for the report. I believe I've fixed the rules - please update to 5.1.5 and let me know if you still run into issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants