Bug 1278823 - fix eslint issues in StyleEditorUI.jsm;r=tromey
authorJulian Descottes <jdescottes@mozilla.com>
Tue, 21 Jun 2016 12:21:47 +0200
changeset 303241 1d60f33e7a441b21f89257cd105ccf61f3745430
parent 303240 7b4e8a8e4f0b3a13e0862d8b54f7e9967069b6d9
child 303242 5f550071f889ff522db03e1e8e86e4cea11b4962
push id19825
push userjdescottes@mozilla.com
push dateThu, 30 Jun 2016 11:51:18 +0000
treeherderfx-team@5f550071f889 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstromey
bugs1278823
milestone50.0a1
Bug 1278823 - fix eslint issues in StyleEditorUI.jsm;r=tromey MozReview-Commit-ID: 7rI0Kw56Vp4
.eslintignore
devtools/server/actors/csscoverage.js
--- a/.eslintignore
+++ b/.eslintignore
@@ -108,16 +108,17 @@ devtools/client/webconsole/**
 !devtools/client/webconsole/console-commands.js
 devtools/client/webide/**
 !devtools/client/webide/components/webideCli.js
 devtools/server/**
 !devtools/server/css-logic.js
 !devtools/server/actors/webbrowser.js
 !devtools/server/actors/styles.js
 !devtools/server/actors/string.js
+!devtools/server/actors/csscoverage.js
 devtools/shared/*.js
 !devtools/shared/css-lexer.js
 !devtools/shared/defer.js
 !devtools/shared/event-emitter.js
 !devtools/shared/task.js
 devtools/shared/*.jsm
 !devtools/shared/Loader.jsm
 devtools/shared/apps/**
--- a/devtools/server/actors/csscoverage.js
+++ b/devtools/server/actors/csscoverage.js
@@ -1,22 +1,21 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
-const { Cc, Ci, Cu } = require("chrome");
+const { Cc, Ci } = require("chrome");
 
 const Services = require("Services");
 const { XPCOMUtils } = require("resource://gre/modules/XPCOMUtils.jsm");
 
 const events = require("sdk/event/core");
 const protocol = require("devtools/shared/protocol");
-const { custom } = protocol;
 const { cssUsageSpec } = require("devtools/shared/specs/csscoverage");
 
 loader.lazyGetter(this, "DOMUtils", () => {
   return Cc["@mozilla.org/inspector/dom-utils;1"].getService(Ci.inIDOMUtils);
 });
 loader.lazyRequireGetter(this, "stylesheets", "devtools/server/actors/stylesheets");
 loader.lazyRequireGetter(this, "prettifyCSS", "devtools/shared/inspector/css-logic", true);
 
@@ -132,18 +131,17 @@ var CSSUsageActor = protocol.ActorClassW
     this._progress = this._tabActor.docShell.QueryInterface(Ci.nsIInterfaceRequestor)
                                             .getInterface(Ci.nsIWebProgress);
     this._progress.addProgressListener(this._progressListener, this._notifyOn);
 
     if (noreload) {
       // If we're not starting by reloading the page, then pretend that onload
       // has just happened.
       this._onTabLoad(this._tabActor.window.document);
-    }
-    else {
+    } else {
       this._tabActor.window.location.reload();
     }
 
     events.emit(this, "state-change", { isRunning: true });
   },
 
   /**
    * Cease recording usage data
@@ -290,18 +288,17 @@ var CSSUsageActor = protocol.ActorClassW
       try {
         let match = document.querySelector(ruleData.test);
         if (match != null) {
           ruleData.isUsed = true;
           if (isLoad) {
             ruleData.preLoadOn.add(url);
           }
         }
-      }
-      catch (ex) {
+      } catch (ex) {
         ruleData.isError = true;
       }
     }
   },
 
   /**
    * Returns a JSONable structure designed to help marking up the style editor,
    * which describes the CSS selector usage.
@@ -411,18 +408,17 @@ var CSSUsageActor = protocol.ActorClassW
       let rules = unusedMap.get(rule.url);
       if (rules == null) {
         rules = [];
         unusedMap.set(rule.url, rules);
       }
       if (!ruleData.isUsed) {
         let ruleReport = ruleToRuleReport(rule, ruleData);
         rules.push(ruleReport);
-      }
-      else {
+      } else {
         summary.unused++;
       }
     }
     let unused = [];
     for (let [url, rules] of unusedMap) {
       unused.push({
         url: url,
         shortUrl: url.split("/").slice(-1),
@@ -440,18 +436,17 @@ var CSSUsageActor = protocol.ActorClassW
       };
 
       for (let [ruleId, ruleData] of this._knownRules) {
         if (ruleData.preLoadOn.has(url)) {
           let rule = deconstructRuleId(ruleId);
           let ruleReport = ruleToRuleReport(rule, ruleData);
           page.rules.push(ruleReport);
           summary.preload++;
-        }
-        else {
+        } else {
           summary.used++;
         }
       }
 
       if (page.rules.length > 0) {
         preload.push(page);
       }
     }
@@ -688,17 +683,19 @@ function getTestSelector(selector) {
  * I've documented all known pseudo-classes above for 2 reasons: To allow
  * checking logic and what might be missing, but also to allow a unit test
  * that fetches the list of supported pseudo-classes and pseudo-elements from
  * the platform and check that they were all represented here.
  */
 exports.SEL_ALL = [
   SEL_EXTERNAL, SEL_FORM, SEL_ELEMENT, SEL_STRUCTURAL, SEL_SEMI,
   SEL_COMBINING, SEL_MEDIA
-].reduce(function (prev, curr) { return prev.concat(curr); }, []);
+].reduce(function (prev, curr) {
+  return prev.concat(curr);
+}, []);
 
 /**
  * Find a URL for a given stylesheet
  * @param stylesheet {StyleSheet|StyleSheetActor}
  */
 const sheetToUrl = exports.sheetToUrl = function (stylesheet) {
   // For <link> elements
   if (stylesheet.href) {