Enable eslint on caps/

RESOLVED FIXED in Firefox 55

Status

RESOLVED FIXED
a year ago
7 months ago

People

(Reporter: gbrown, Assigned: gbrown)

Tracking

(Blocks: 1 bug)

Trunk
mozilla55

Firefox Tracking Flags

(firefox55 fixed)

Details

Attachments

(1 attachment, 1 obsolete attachment)

Comment hidden (empty)
(Assignee)

Comment 1

a year ago
Created attachment 8864539 [details] [diff] [review]
enable eslint on caps/

Changes are mostly mechanical substitutions. All the js files in caps/ are under caps/tests.

browser_checkloaduri.js has a curious structure that seems to confuse eslint on several counts; rather than try to address all the issues with annotations, I thought it best to just skip the file.
Attachment #8864539 - Flags: review?(standard8)
Comment on attachment 8864539 [details] [diff] [review]
enable eslint on caps/

Review of attachment 8864539 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good, but there's a couple of things I think we can improve on.

::: caps/tests/mochitest/.eslintrc.js
@@ +1,5 @@
> +"use strict";
> +
> +module.exports = {
> +  "extends": [
> +    "plugin:mozilla/mochitest-test"

The browser_checkloaduri.js issue is because caps is including mochitests & browser tests in the same directory (see the mochitest.ini and browser.ini). As a result, you need to add:

"plugin:mozilla/browser-test",

here, that should solve most of the issues in that file.

Alternately file a follow-up, and we'll set it up as a mentored bug once this lands.

::: caps/tests/mochitest/test_bug292789.html
@@ +25,4 @@
>   ** even for ALLOW_CHROME mechanisms (<script>, <img> etc)
>   **/
>  
> +/* globals gTreeUtils */

Since this file is actually loading the treeUtils.js script, it is cleaner to do:

/* import-globals-from ../../../toolkit/content/treeUtils.js */

That'll also mean if anyone changes gTreeUtils in that file, and misses this test, then eslint will pick it up.
Attachment #8864539 - Flags: review?(standard8)
(Assignee)

Updated

a year ago
See Also: → bug 1362421
(Assignee)

Comment 4

a year ago
Created attachment 8864891 [details] [diff] [review]
enable eslint on caps/

I added the browser-test plugin: It fixes all the "easy" issues in that test, but not the ones that are giving me pause -- I filed bug 1362421 to follow-up.

I also changed from globals to import-globals-from - I totally agree that's better. Thanks!
Attachment #8864539 - Attachment is obsolete: true
Attachment #8864891 - Flags: review?(standard8)
Comment on attachment 8864891 [details] [diff] [review]
enable eslint on caps/

Review of attachment 8864891 [details] [diff] [review]:
-----------------------------------------------------------------

Great, thanks for the updates.
Attachment #8864891 - Flags: review?(standard8) → review+

Comment 6

a year ago
Pushed by gbrown@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/b99cdf171a9b
Enable eslint on caps/ directory; r=standard8

Comment 7

a year ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/b99cdf171a9b
Status: NEW → RESOLVED
Last Resolved: a year ago
status-firefox55: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55

Updated

7 months ago
Product: Testing → Firefox Build System
You need to log in before you can comment on or make changes to this bug.