Closed Bug 1242893 Opened 10 years ago Closed 7 years ago

Change the import-globals-from eslint custom rule to also register properties added to the top-level `this` in JSM modules as globals

Categories

(Developer Infrastructure :: Lint and Formatting, defect, P4)

defect

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: pbro, Unassigned)

Details

TIL: JSM modules that need to work on b2g too need to export their globals on `this`. So, for instance, in \devtools\client\framework\ToolboxProcess.jsm there are these 2 lines: this.EXPORTED_SYMBOLS = ["BrowserToolboxProcess"]; this.BrowserToolboxProcess = function BrowserToolboxProcess(... The import-from-globals eslint rule https://dxr.mozilla.org/mozilla-central/source/testing/eslint-plugin-mozilla/lib/rules/import-globals-from.js is useful in many cases where you don't want to manually manage a list of globals in an eslint /*globals */ comment, but unfortunately, it doesn't well with these JSM modules.
Bug 1231963 is related. I think there's a general problem where these "helper rules" aren't run when trying to compute the globals of a file. See bug 1242584 for another example.
Component: General → ESLint
Priority: -- → P4
Product: Testing → Firefox Build System
In bug 1440284 we've moved away from using this.*, so I believe this is now a wontfix.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.