Bug 1374671 - Enable the ESLint no-whitespace-before-property rule across mozilla-central. r=standard8
authorLuciano Italiani <lyretandrpg@gmail.com>
Thu, 27 Jul 2017 23:01:13 -0300
changeset 420542 34c157df46d2be2e0f71f5f87e6a649c79ccff4c
parent 420541 770c9d02352d1af7af74f6cc18f209727db7cc7a
child 420543 24dea787604ee66bc213977def7de4a62e4a602d
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersstandard8
bugs1374671
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1374671 - Enable the ESLint no-whitespace-before-property rule across mozilla-central. r=standard8 MozReview-Commit-ID: 4WkNg0YrgHx
browser/components/uitour/test/browser_fxa.js
browser/experiments/test/xpcshell/test_cache.js
devtools/client/netmonitor/test/browser_net_content-type.js
devtools/client/netmonitor/test/browser_net_timeline_ticks.js
devtools/client/sourceeditor/css-autocompleter.js
mobile/android/modules/geckoview/Messaging.jsm
security/.eslintrc.js
toolkit/components/prompts/test/test_modal_prompts.html
toolkit/components/telemetry/tests/unit/test_TelemetrySession.js
tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js
--- a/browser/components/uitour/test/browser_fxa.js
+++ b/browser/components/uitour/test/browser_fxa.js
@@ -33,17 +33,17 @@ var tests = [
     let highlight = document.getElementById("UITourHighlightContainer");
     is(highlight.getAttribute("targetName"), "accountStatus", "Correct highlight target");
   }),
 
   taskify(async function test_highlight_accountStatus_loggedIn() {
     await setSignedInUser();
     let userData = await fxAccounts.getSignedInUser();
     isnot(userData, null, "Logged in now");
-    gSync.updateAllUI({ status: UIState. STATUS_SIGNED_IN, email: "foo@example.com" });
+    gSync.updateAllUI({ status: UIState.STATUS_SIGNED_IN, email: "foo@example.com" });
     await showMenuPromise("appMenu");
     await showHighlightPromise("accountStatus");
     let highlight = document.getElementById("UITourHighlightContainer");
     let photon = Services.prefs.getBoolPref("browser.photon.structure.enabled");
     let expectedTarget = photon ? "appMenu-fxa-avatar" : "PanelUI-fxa-avatar";
     is(highlight.popupBoxObject.anchorNode.id, expectedTarget, "Anchored on avatar");
     is(highlight.getAttribute("targetName"), "accountStatus", "Correct highlight target");
   }),
--- a/browser/experiments/test/xpcshell/test_cache.js
+++ b/browser/experiments/test/xpcshell/test_cache.js
@@ -125,17 +125,17 @@ add_task(async function test_cache() {
 
   let baseDate   = new Date(2014, 5, 1, 12);
   let startDates = [];
   let endDates   = [];
 
   for (let i = 0; i < gManifestObject.experiments.length; ++i) {
     let experiment = gManifestObject.experiments[i];
     startDates.push(futureDate(baseDate, (50 + (150 * i)) * MS_IN_ONE_DAY));
-    endDates .push(futureDate(startDates[i], 50 * MS_IN_ONE_DAY));
+    endDates.push(futureDate(startDates[i], 50 * MS_IN_ONE_DAY));
     experiment.startTime = dateToSeconds(startDates[i]);
     experiment.endTime   = dateToSeconds(endDates[i]);
   }
 
   // Data to compare the result of Experiments.getExperiments() against.
 
   let experimentListData = [
     {
@@ -306,17 +306,17 @@ add_task(async function test_expiration(
   let startDates = [];
   let endDates   = [];
 
   for (let i = 0; i < gManifestObject.experiments.length; ++i) {
     let experiment = gManifestObject.experiments[i];
     // Spread out experiments in time so that one experiment can end and expire while
     // the next is still running.
     startDates.push(futureDate(baseDate, (50 + (200 * i)) * MS_IN_ONE_DAY));
-    endDates .push(futureDate(startDates[i], 50 * MS_IN_ONE_DAY));
+    endDates.push(futureDate(startDates[i], 50 * MS_IN_ONE_DAY));
     experiment.startTime = dateToSeconds(startDates[i]);
     experiment.endTime   = dateToSeconds(endDates[i]);
   }
 
   let now = null;
   let experiments = null;
 
   let setDateAndRestartExperiments = async function(newDate) {
--- a/devtools/client/netmonitor/test/browser_net_content-type.js
+++ b/devtools/client/netmonitor/test/browser_net_content-type.js
@@ -176,17 +176,17 @@ add_task(function* () {
         box != "image",
         "The response image view doesn't display");
     }
 
     switch (type) {
       case "xml": {
         checkVisibility("textarea");
 
-        let text = document .querySelector(".CodeMirror-line").textContent;
+        let text = document.querySelector(".CodeMirror-line").textContent;
 
         is(text, "<label value='greeting'>Hello XML!</label>",
           "The text shown in the source editor is incorrect for the xml request.");
         break;
       }
       case "css": {
         checkVisibility("textarea");
 
--- a/devtools/client/netmonitor/test/browser_net_timeline_ticks.js
+++ b/devtools/client/netmonitor/test/browser_net_timeline_ticks.js
@@ -119,19 +119,19 @@ add_task(function* () {
   function hasPixelAt(x) {
     let i = (x | 0) * 4;
     return data[i] && data[i + 1] && data[i + 2] && data[i + 3];
   }
 
   function isPixelBrighterAtThan(x1, x2) {
     let i = (x1 | 0) * 4;
     let j = (x2 | 0) * 4;
-    return data[i + 3] > data [j + 3];
+    return data[i + 3] > data[j + 3];
   }
 
   function isPixelEquallyBright(x1, x2) {
     let i = (x1 | 0) * 4;
     let j = (x2 | 0) * 4;
-    return data[i + 3] == data [j + 3];
+    return data[i + 3] == data[j + 3];
   }
 
   return teardown(monitor);
 });
--- a/devtools/client/sourceeditor/css-autocompleter.js
+++ b/devtools/client/sourceeditor/css-autocompleter.js
@@ -919,17 +919,17 @@ CSSCompleter.prototype = {
     if (arr[high][0] <= line) {
       return high;
     }
     if (arr[low][0] > line) {
       return -1;
     }
 
     while (high > low) {
-      if (arr[low][0] <= line && arr[low [0] + 1] > line) {
+      if (arr[low][0] <= line && arr[low[0] + 1] > line) {
         return low;
       }
       if (arr[high][0] > line && arr[high - 1][0] <= line) {
         return high - 1;
       }
 
       target = (((line - arr[low][0]) / (arr[high][0] - arr[low][0])) *
                 (high - low)) | 0;
--- a/mobile/android/modules/geckoview/Messaging.jsm
+++ b/mobile/android/modules/geckoview/Messaging.jsm
@@ -243,17 +243,17 @@ var EventDispatcher = {
       };
       callback = {
         onSuccess: response => reply("success", response),
         onError: error => reply("error", error),
       };
     }
 
     if (aMsg.data.global) {
-      this.instance.dispatch(aMsg.data.event, aMsg.data.data. callback);
+      this.instance.dispatch(aMsg.data.event, aMsg.data.data.callback);
       return;
     }
 
     let win = aMsg.target.contentWindow || aMsg.target.ownerGlobal;
     let dispatcher = win.WindowEventDispatcher || this.for(win);
     dispatcher.dispatch(aMsg.data.event, aMsg.data.data, callback);
   },
 };
--- a/security/.eslintrc.js
+++ b/security/.eslintrc.js
@@ -76,19 +76,16 @@ module.exports = {
     "no-unmodified-loop-condition": "error",
 
     // No expressions where a statement is expected
     "no-unused-expressions": "error",
 
     // Disallow unnecessary escape usage in strings and regular expressions.
     "no-useless-escape": "error",
 
-    // Disallow whitespace before properties.
-    "no-whitespace-before-property": "error",
-
     // Disallow blank line padding within blocks.
     "padded-blocks": ["error", "never"],
 
     // Always require semicolon at end of statement
     "semi": ["error", "always"],
 
     // Enforce spacing after semicolons.
     "semi-spacing": ["error", { "before": false, "after": true }],
--- a/toolkit/components/prompts/test/test_modal_prompts.html
+++ b/toolkit/components/prompts/test/test_modal_prompts.html
@@ -1062,17 +1062,17 @@ async function runTests() {
         await promptDone;
     }
 
     info("Starting test: promptAuth for a cross-origin and a empty realm");
     authinfo = {
         username: "",
         password: "",
         domain: "",
-        flags: Ci. nsIAuthInformation.AUTH_HOST |
+        flags: Ci.nsIAuthInformation.AUTH_HOST |
                Ci.nsIAuthInformation.CROSS_ORIGIN_SUB_RESOURCE,
         authenticationScheme: "basic",
         realm: ""
     }
     state = {
         msg: "http://example.com is requesting your username and password. " +
               "WARNING: Your password will not be sent to the website you are currently visiting!",
         title: "TestTitle",
@@ -1106,17 +1106,17 @@ async function runTests() {
         await promptDone;
     }
 
     info("Starting test: promptAuth for a cross-origin with realm");
     authinfo = {
         username: "",
         password: "",
         domain: "",
-        flags: Ci. nsIAuthInformation.AUTH_HOST | Ci.nsIAuthInformation.CROSS_ORIGIN_SUB_RESOURCE,
+        flags: Ci.nsIAuthInformation.AUTH_HOST | Ci.nsIAuthInformation.CROSS_ORIGIN_SUB_RESOURCE,
         authenticationScheme: "basic",
         realm: "Something!!!"
     }
     state = {
         msg: "http://example.com is requesting your username and password. " +
               "WARNING: Your password will not be sent to the website you are currently visiting!",
         title: "TestTitle",
         iconClass: "authentication-icon question-icon",
--- a/toolkit/components/telemetry/tests/unit/test_TelemetrySession.js
+++ b/toolkit/components/telemetry/tests/unit/test_TelemetrySession.js
@@ -245,17 +245,17 @@ function checkScalars(processes) {
                   name + " contains an unsupported value type (" + valueType + ")");
     }
   }
 
   // Check that we have valid scalar entries.
   const scalars = parentProcess.scalars;
   for (let name in scalars) {
     Assert.equal(typeof name, "string", "Scalar names must be strings.");
-    checkScalar(scalars [name]);
+    checkScalar(scalars[name]);
   }
 
   // Check that we have valid keyed scalar entries.
   const keyedScalars = parentProcess.keyedScalars;
   for (let name in keyedScalars) {
     Assert.equal(typeof name, "string", "Scalar names must be strings.");
     Assert.ok(Object.keys(keyedScalars[name]).length,
               "The reported keyed scalars must contain at least 1 key.");
--- a/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js
+++ b/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js
@@ -326,16 +326,19 @@ module.exports = {
 
     // Don't concatenate string literals together (unless they span multiple
     // lines)
     "no-useless-concat": "error",
 
     // Disallow redundant return statements
     "no-useless-return": "error",
 
+    // Disallow whitespace before properties.
+    "no-whitespace-before-property": "error",
+
     // No using with
     "no-with": "error",
 
     // Require object-literal shorthand with ES6 method syntax
     "object-shorthand": ["error", "always", { "avoidQuotes": true }],
 
     // Require double-quotes everywhere, except where quotes are escaped
     // or template literals are used.