Add handling of loadSubScript globals to ESLint
Categories
(Developer Infrastructure :: Lint and Formatting, task, P3)
Tracking
(firefox111 fixed)
Tracking | Status | |
---|---|---|
firefox111 | --- | fixed |
People
(Reporter: standard8, Assigned: standard8)
Details
Attachments
(8 files)
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
In a lot of places, we're doing things like:
/* import-globals-from ../shared-head.js */
Services.scriptloader.loadSubScript(
"chrome://mochitests/content/browser/accessible/tests/browser/shared-head.js",
this
);
Since we know that chrome://mochitests/content/browser/
is effectively pointing to the base of the source tree, then in most instances we should be able to load the globals automatically without needing the import-globals-from
.
For this, we will need to set these globals as non-explicit, so that the no-unused-vars rule doesn't pick them up in the case of only using not all of the globals that are imported.
Doing this will make it easier for developers and cut down the amount of extra comments in the code base.
Assignee | ||
Comment 1•2 months ago
|
||
Try push (although most of it is comments-only so it shouldn't affect things, but just in case...): https://treeherder.mozilla.org/jobs?repo=try&revision=fa3a5f6d10d1562396038d8da41ec2053088a8a1
Assignee | ||
Comment 2•2 months ago
|
||
This is a better location for these functions and helps avoid circular dependencies in the next patches.
Assignee | ||
Comment 3•2 months ago
|
||
Depends on D168067
Assignee | ||
Comment 4•2 months ago
|
||
Depends on D168068
Assignee | ||
Comment 5•2 months ago
|
||
Depends on D168069
Assignee | ||
Comment 6•2 months ago
|
||
Depends on D168070
Assignee | ||
Comment 7•2 months ago
|
||
Depends on D168071
Assignee | ||
Comment 8•2 months ago
|
||
Depends on D168072
Assignee | ||
Comment 9•2 months ago
|
||
Depends on D168073
Comment 10•2 months ago
|
||
Pushed by mbanner@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/bc28a70ceac6 Move ESLint functions for globals handling from helpers.js to globals.js. r=Gijs https://hg.mozilla.org/integration/autoland/rev/3279fa5e3cfb Add basic support for loadSubScript handling to ESLint. r=Gijs https://hg.mozilla.org/integration/autoland/rev/3747e47fa4f2 Remove now unnecessary import-globals-from statements in accessible. r=Gijs https://hg.mozilla.org/integration/autoland/rev/9c8083315f17 Remove now unnecessary import-globals-from statements in browser. r=settings-reviewers,mconley https://hg.mozilla.org/integration/autoland/rev/c7d030abf4fb Remove now unnecessary import-globals-from statements in devtools. r=Gijs https://hg.mozilla.org/integration/autoland/rev/e67aa87d79c2 Remove now unnecessary import-globals-from statements in toolkit. r=Gijs,application-update-reviewers,credential-management-reviewers,sgalich,bytesized https://hg.mozilla.org/integration/autoland/rev/3f4e3ed1e2b6 Remove now unnecessary import-globals-from statements in dom. r=Gijs,webdriver-reviewers,whimboo https://hg.mozilla.org/integration/autoland/rev/4fa7cb10f64e Remove now unnecessary import-globals-from statements in other directories. r=Gijs,webdriver-reviewers,whimboo
Comment 11•2 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/bc28a70ceac6
https://hg.mozilla.org/mozilla-central/rev/3279fa5e3cfb
https://hg.mozilla.org/mozilla-central/rev/3747e47fa4f2
https://hg.mozilla.org/mozilla-central/rev/9c8083315f17
https://hg.mozilla.org/mozilla-central/rev/c7d030abf4fb
https://hg.mozilla.org/mozilla-central/rev/e67aa87d79c2
https://hg.mozilla.org/mozilla-central/rev/3f4e3ed1e2b6
https://hg.mozilla.org/mozilla-central/rev/4fa7cb10f64e
Description
•