ESlint 8.11.0: Cannot read properties of undefined (reading 'type') caused by eslint-plugin-mozilla
Categories
(Developer Infrastructure :: Lint and Formatting, task, P3)
Tracking
(firefox100 fixed)
Tracking | Status | |
---|---|---|
firefox100 | --- | fixed |
People
(Reporter: standard8, Assigned: standard8)
References
Details
Attachments
(4 files)
On a local project that also used eslint-plugin-mozilla, I've just tried upgrading to ESLint 8.11.0 and found there were failures caused:
TypeError: Cannot read properties of undefined (reading 'type')
Occurred while linting /Users/mark/dev/thunderbird-conversations/addon/content/modules/conversation.js:7
Rule: "no-unused-vars"
at collectUnusedVariables (/Users/mark/dev/thunderbird-conversations/node_modules/eslint/lib/rules/no-unused-vars.js:606:49)
This is caused by our globals handling for XPCOM.* imports. I have a solution for this and will post a patch soon.
Assignee | ||
Comment 1•2 years ago
|
||
Assignee | ||
Comment 2•2 years ago
|
||
ESLint is only documenting the new module style of meta data and returning a create function.
Using this format allows us to easily specify extra meta data, e.g. documentation urls.
Hence, lets move all our rules across to the newer style so that any copy and paste will use
the new style, and we'll also be set up if ESLint requires it in the future.
Assignee | ||
Comment 3•2 years ago
|
||
Depends on D142284
Assignee | ||
Comment 4•2 years ago
|
||
This metadata is based on what I thik we should include. We don't need most
of the documentation section (category, description) since they are specific
to ESLint. The url is useful, as it will show up in VSCode and other editors
for developers wanting more information.
The type of rule probably isn't important, but is kept as a general guide.
Depends on D142285
Pushed by mbanner@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/249dc5724ff8 Rework ESLint rules for eslint-plugin-mozilla to use the newer more descriptive rule format. r=Gijs https://hg.mozilla.org/integration/autoland/rev/4b551467968d Add missing docs for rules in eslint-plugin-mozilla. r=Gijs https://hg.mozilla.org/integration/autoland/rev/026a3213aeff Add metadata for all eslint-plugin-mozilla rules. r=Gijs https://hg.mozilla.org/integration/autoland/rev/736dd080afc2 Fix issue in eslint-plugin-mozilla where it fails with ESLint v8.11.0 due to the processing of XPCOMUtils.* import functions. r=Gijs
Comment 6•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/249dc5724ff8
https://hg.mozilla.org/mozilla-central/rev/4b551467968d
https://hg.mozilla.org/mozilla-central/rev/026a3213aeff
https://hg.mozilla.org/mozilla-central/rev/736dd080afc2
Updated•2 years ago
|
Description
•