Skip to content

Broken with ESLint 10 #60

Description

@oNo500

Hey, just upgraded to ESLint 10 and the plugin is completely broken — every file fails with this:

TypeError: Error while loading rule 'depend/ban-dependencies': Cannot read properties of undefined (reading 'bind')
    at Object.ruleCreate [as create] (.../node_modules/@eslint/compat/dist/esm/index.js:139:38)

ESLint 10 removed a bunch of deprecated context methods (context.getFilename(), context.getSourceCode(), etc.) that the plugin seems to be relying on. Wrapping with fixupPluginRules from @eslint/compat doesn't help either — the rule itself still blows up.

Versions:

  • eslint-plugin-depend: 1.4.0
  • eslint: 10.0.2

The fix should be switching to the new equivalents (context.filename, context.sourceCode, etc.). ESLint's migration guide has the full list.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions