Skip to content

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

Closed

Description

@rbnts

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.

Activity

  1. silverwind commented on Dec 19, 2024

    @silverwind

    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)
    
  2. gracepark commented on Jan 6, 2025

    @gracepark
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions