Closed
Bug 1771751
Opened 2 years ago
Closed 2 years ago
Add ESLint rule that rejects static import for system ESM from non-system ESM
Categories
(Developer Infrastructure :: Lint and Formatting, task)
Developer Infrastructure
Lint and Formatting
Tracking
(firefox103 fixed)
RESOLVED
FIXED
103 Branch
Tracking | Status | |
---|---|---|
firefox103 | --- | fixed |
People
(Reporter: arai, Assigned: arai)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
At the top-level of the system ESM, other system ESMs can be imported with static import
declaration.
This works as expected only inside system ESM, and doing the same in non-system ESM (such as module loaded by <script type="module" ...>
in chrome-priv window) doesn't work as expected:
- the module (and dependents) is loaded into different global than then shared global, and it's not the per-process singleton
- it doesn't immediately throw error, because system ESM is subset of standard ESM
And this situation likely to happen by copy-paste the code that imports system ESM, from system ESM to non-system ESM.
we'd better having an ESLint rule that detects such situation and throw error.
Assignee | ||
Updated•2 years ago
|
Component: XPConnect → Lint and Formatting
Product: Core → Firefox Build System
Assignee | ||
Updated•2 years ago
|
Blocks: esm-ification
Assignee | ||
Comment 1•2 years ago
|
||
Updated•2 years ago
|
Assignee: nobody → arai.unmht
Status: NEW → ASSIGNED
Pushed by arai_a@mac.com: https://hg.mozilla.org/integration/autoland/rev/b94c92657e73 Reject static import for system module from non-system module. r=Standard8
Comment 3•2 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 2 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
•