Closed
Bug 1478305
Opened 7 years ago
Closed 7 years ago
ESLint should treat ChomeUtils.import as real variable definitions where possible
Categories
(Developer Infrastructure :: Lint and Formatting, enhancement, P2)
Developer Infrastructure
Lint and Formatting
Tracking
(firefox63 fixed)
RESOLVED
FIXED
mozilla63
| Tracking | Status | |
|---|---|---|
| firefox63 | --- | fixed |
People
(Reporter: standard8, Assigned: standard8)
References
Details
Attachments
(7 files)
|
59 bytes,
text/x-review-board-request
|
mossop
:
review+
|
Details |
|
59 bytes,
text/x-review-board-request
|
mossop
:
review+
|
Details |
|
59 bytes,
text/x-review-board-request
|
Details | |
|
59 bytes,
text/x-review-board-request
|
bwc
:
review+
|
Details |
|
59 bytes,
text/x-review-board-request
|
snorp
:
review+
|
Details |
|
59 bytes,
text/x-review-board-request
|
mossop
:
review+
|
Details |
|
59 bytes,
text/x-review-board-request
|
mossop
:
review+
|
Details |
Building on Kris' change in bug 1456686 to treat some imports as real variable definitions, I think we can do the same for Cu.import, where the imported module has only one export.
This will help us eliminate more unused imports, mainly in *.jsm files where we have no-unused-vars in the global scope. There's a few other locations where that is also enabled globally so they will benefit as well.
| Assignee | ||
Comment 1•7 years ago
|
||
Note: the reason we can't really do it for modules that have more than one export (at the moment), is that if only one export is used it'll flag the others as unused.
We can maybe have a follow-up to start to get people to use the explicit form of imports.
Summary: ESLint should treat Cu.import as real variable definitions where possible → ESLint should treat ChomeUtils.import as real variable definitions where possible
| Comment hidden (mozreview-request) |
| Assignee | ||
Updated•7 years ago
|
Priority: -- → P2
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
Comment 16•7 years ago
|
||
| mozreview-review | ||
Comment on attachment 8995923 [details]
Bug 1478305 - Remove unnecessary ChromeUtils.import calls in mobile/.
https://reviewboard.mozilla.org/r/260222/#review267288
Attachment #8995923 -
Flags: review?(snorp) → review+
Comment 17•7 years ago
|
||
| mozreview-review | ||
Comment on attachment 8995922 [details]
Bug 1478305 - Remove unnecessary ChromeUtils.import calls in dom/media.
https://reviewboard.mozilla.org/r/260220/#review267296
Attachment #8995922 -
Flags: review?(docfaraday) → review+
Comment 18•7 years ago
|
||
| mozreview-review | ||
Comment on attachment 8995920 [details]
Bug 1478305 - For xpcshell-test head files, limit checking no-unused-vars to the local scope only.
https://reviewboard.mozilla.org/r/260216/#review267344
Attachment #8995920 -
Flags: review?(dtownsend) → review+
Comment 19•7 years ago
|
||
| mozreview-review | ||
Comment on attachment 8995924 [details]
Bug 1478305 - Remove unnecessary ChromeUtils.import calls in testing/.
https://reviewboard.mozilla.org/r/260224/#review267346
::: testing/marionette/test/unit/test_cookie.js:43
(Diff revision 2)
> - let hostCookies = this.cookies.filter(cookie => cookie.host === host ||
> - cookie.host === "." + host);
> + let hostCookies = this.cookies.filter(c => c.host === host ||
> + c.host === "." + host);
This change looks unrelated.
Attachment #8995924 -
Flags: review?(dtownsend) → review+
Comment 20•7 years ago
|
||
| mozreview-review | ||
Comment on attachment 8995925 [details]
Bug 1478305 - Remove unnecessary imports and fix ESLint warnings about unused variables for toolkit/.
https://reviewboard.mozilla.org/r/260226/#review267348
Attachment #8995925 -
Flags: review?(dtownsend) → review+
Comment 21•7 years ago
|
||
| mozreview-review | ||
Comment on attachment 8994782 [details]
Bug 1478305 - Update ESLint to treat ChromeUtils.import definitions as real variable definitions for single-export modules.
https://reviewboard.mozilla.org/r/259314/#review267350
Attachment #8994782 -
Flags: review?(dtownsend) → review+
| Assignee | ||
Comment 22•7 years ago
|
||
| mozreview-review-reply | ||
Comment on attachment 8995924 [details]
Bug 1478305 - Remove unnecessary ChromeUtils.import calls in testing/.
https://reviewboard.mozilla.org/r/260224/#review267346
> This change looks unrelated.
This is needed, because the import at the top of the file is importing a global named `cookie`, which now conflicts with this variable and triggers the no-shadow rule.
| Assignee | ||
Updated•7 years ago
|
Attachment #8995921 -
Flags: review?(MattN+bmo) → review?(jaws)
Comment 23•7 years ago
|
||
| mozreview-review | ||
Comment on attachment 8995921 [details]
Bug 1478305 - Remove unnecessary imports and fix ESLint warnings about unused variables for browser/.
https://reviewboard.mozilla.org/r/260218/#review267810
Attachment #8995921 -
Flags: review?(jaws) → review+
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Assignee | ||
Comment 37•7 years ago
|
||
The updates were for bitrot (and fixing my forget to change reviewer in commit message), and to add a version bump for eslint-plugin-mozilla so that we can update it for those that use it outside.
Comment 38•7 years ago
|
||
Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/60a10f910397
For xpcshell-test head files, limit checking no-unused-vars to the local scope only. r=mossop
https://hg.mozilla.org/integration/autoland/rev/ed8954c61a36
Remove unnecessary imports and fix ESLint warnings about unused variables for browser/. r=jaws
https://hg.mozilla.org/integration/autoland/rev/a0a4329018c2
Remove unnecessary ChromeUtils.import calls in dom/media. r=bwc
https://hg.mozilla.org/integration/autoland/rev/90115883e292
Remove unnecessary ChromeUtils.import calls in mobile/. r=snorp
https://hg.mozilla.org/integration/autoland/rev/d3cca460f38d
Remove unnecessary ChromeUtils.import calls in testing/. r=mossop
https://hg.mozilla.org/integration/autoland/rev/d28accbc115d
Remove unnecessary imports and fix ESLint warnings about unused variables for toolkit/. r=mossop
https://hg.mozilla.org/integration/autoland/rev/0fd5b04d2dee
Update ESLint to treat ChromeUtils.import definitions as real variable definitions for single-export modules. r=mossop
Comment 39•7 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/60a10f910397
https://hg.mozilla.org/mozilla-central/rev/ed8954c61a36
https://hg.mozilla.org/mozilla-central/rev/a0a4329018c2
https://hg.mozilla.org/mozilla-central/rev/90115883e292
https://hg.mozilla.org/mozilla-central/rev/d3cca460f38d
https://hg.mozilla.org/mozilla-central/rev/d28accbc115d
https://hg.mozilla.org/mozilla-central/rev/0fd5b04d2dee
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox63:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
Comment 40•7 years ago
|
||
Commit pushed to master at https://github.com/mozilla/activity-stream
https://github.com/mozilla/activity-stream/commit/1150780da479166f959008147bdb5995ac3de093
Port Bug 1478305 - Remove unnecessary imports and fix ESLint warnings about unused variables for browser/. r=jaws
Updated•3 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
•