Closed Bug 1361859 Opened 6 years ago Closed 6 years ago

Enable eslint on caps/


(Developer Infrastructure :: Lint and Formatting, enhancement)

Not set


(firefox55 fixed)

Tracking Status
firefox55 --- fixed


(Reporter: gbrown, Assigned: gbrown)




(1 file, 1 obsolete file)

      No description provided.
Attached patch enable eslint on caps/ (obsolete) — Splinter Review
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:


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)
See Also: → 1362421
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+
Pushed by
Enable eslint on caps/ directory; r=standard8
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Product: Testing → Firefox Build System
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.