Closed Bug 1957602 Opened 21 days ago Closed 21 days ago

TypeError: context.getAncestors is not a function from var-only-at-top-level

Categories

(Developer Infrastructure :: Lint and Formatting, defect)

defect

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: tabmix.onemen, Unassigned)

Details

Using var-only-at-top-level rule from eslint-plugin-mozilla throw an error

TypeError: context.getAncestors is not a function

Please can you give a bit more information, including how you are using this, which version, and which versions of ESLint you are using? The information you have given is not enough, the rule is working in our code base.

Flags: needinfo?(tabmix.onemen)

I am using it locally to lint an extension

from my package.json

"eslint": "^9.23.0",
"eslint-plugin-mozilla": "^4.0.0",

eslint-plugin-mozilla version 4.0.0 is the last in NPM

note that var-only-at-top-level is the only place in the code that uses context.getAncestors() directly all other places use helpers.getAncestors

Flags: needinfo?(tabmix.onemen)

Ah, we've been updating it in the tree, but I've been forgetting to publish it. So I've just published v4.2.1 which should hopefully work.

Status: NEW → RESOLVED
Closed: 21 days ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.