Closed
Bug 1771173
Opened 3 years ago
Closed 3 years ago
Add a rule/detection for invalid accesses of modules when using ChromeUtils.defineLazyESModuleGetters
Categories
(Developer Infrastructure :: Lint and Formatting, task, P2)
Developer Infrastructure
Lint and Formatting
Tracking
(firefox103 fixed)
RESOLVED
FIXED
103 Branch
Tracking | Status | |
---|---|---|
firefox103 | --- | fixed |
People
(Reporter: standard8, Assigned: standard8)
References
Details
Attachments
(6 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 |
With moving to ESM modules, we are planning on defining a new system for lazy getters:
let lazy = {};
ChromeUtils.defineLazyESModuleGetters(lazy, {
MyService: "MyService.sys.mjs",
});
// Access
lazy.MyService.add(1);
Whilst ESLint will automatically detect the lazy
variable, I think we should be able to extend it to know what is available within lazy
and report invalid accesses.
Assignee | ||
Comment 1•3 years ago
|
||
Assignee | ||
Comment 2•3 years ago
|
||
Assignee | ||
Comment 3•3 years ago
|
||
Assignee | ||
Comment 4•3 years ago
|
||
Updated•3 years ago
|
Attachment #9281975 -
Attachment description: WIP: Bug 1771173 - Make XPIDatabase lazy getters easier to work with ESLint. → WIP: Bug 1771173 - Make XPIDatabase/XPIInstall lazy getters easier to work with linters.
Assignee | ||
Comment 5•3 years ago
|
||
Depends on D149717
Assignee | ||
Comment 6•3 years ago
|
||
Depends on D149785
Updated•3 years ago
|
Attachment #9281973 -
Attachment description: WIP: Bug 1771173 - Fix/ignore some duplicate imports caught by the new valid-lazy rule. → Bug 1771173 - Fix/ignore some duplicate imports caught by the new valid-lazy rule. r?arai
Updated•3 years ago
|
Attachment #9281974 -
Attachment description: WIP: Bug 1771173 - Rework FormAutoFill's log creation to make it easier for linters to handle. → Bug 1771173 - Rework FormAutoFill's log creation to make it easier for linters to handle. r?sgalich
Updated•3 years ago
|
Attachment #9281975 -
Attachment description: WIP: Bug 1771173 - Make XPIDatabase/XPIInstall lazy getters easier to work with linters. → Bug 1771173 - Make XPIDatabase/XPIInstall lazy getters easier to work with linters. r?#extension-reviewers
Updated•3 years ago
|
Attachment #9282080 -
Attachment description: WIP: Bug 1771173 - Clean up unused definitions of console in extension modules. → Bug 1771173 - Clean up unused definitions of console in extension modules. r?#extension-reviewers
Updated•3 years ago
|
Attachment #9282081 -
Attachment description: WIP: Bug 1771173 - Remove unused imports. → Bug 1771173 - Remove unused imports. r?arai!,#geckoview-reviewers
Updated•3 years ago
|
Attachment #9281976 -
Attachment description: WIP: Bug 1771173 - Add ESLint rule to check for correct usages of lazy. → Bug 1771173 - Add ESLint rule to check for correct usages of lazy. r?arai
Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/542f213b208f
Fix/ignore some duplicate imports caught by the new valid-lazy rule. r=arai
https://hg.mozilla.org/integration/autoland/rev/e270b8b7f8bd
Rework FormAutoFill's log creation to make it easier for linters to handle. r=sgalich
https://hg.mozilla.org/integration/autoland/rev/b1415a0f03a0
Make XPIDatabase/XPIInstall lazy getters easier to work with linters. r=mixedpuppy
https://hg.mozilla.org/integration/autoland/rev/fe89c8b44d12
Clean up unused definitions of console in extension modules. r=mixedpuppy
https://hg.mozilla.org/integration/autoland/rev/ad6ec35d0534
Remove unused imports. r=geckoview-reviewers,arai,owlish
https://hg.mozilla.org/integration/autoland/rev/eb2616c17dd6
Add ESLint rule to check for correct usages of lazy. r=arai
Comment 8•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/542f213b208f
https://hg.mozilla.org/mozilla-central/rev/e270b8b7f8bd
https://hg.mozilla.org/mozilla-central/rev/b1415a0f03a0
https://hg.mozilla.org/mozilla-central/rev/fe89c8b44d12
https://hg.mozilla.org/mozilla-central/rev/ad6ec35d0534
https://hg.mozilla.org/mozilla-central/rev/eb2616c17dd6
Status: NEW → RESOLVED
Closed: 3 years ago
status-firefox103:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 103 Branch
Updated•2 years ago
|
Product: Firefox Build System → Developer Infrastructure
You need to log in
before you can comment on or make changes to this bug.
Description
•