Bug 1278138 - Enforce stricter eslint rules (arrow-spacing) on passwordmgr draft
authorSaad Quadri <saad@saadquadri.com>
Tue, 07 Jun 2016 12:08:42 -0700
changeset 376350 ed128842c4d510614e0dcc99bc391c0637e41a5d
parent 376349 ef4625b3388a07ea18f5ac2976875d79008e7cec
child 523124 e953da188d39ccb2fc7bd63e4682344eee45cb5e
push id20547
push userbmo:saad@saadquadri.com
push dateTue, 07 Jun 2016 19:07:34 +0000
bugs1278138
milestone50.0a1
Bug 1278138 - Enforce stricter eslint rules (arrow-spacing) on passwordmgr MozReview-Commit-ID: D8djouoMxFy
toolkit/components/passwordmgr/.eslintrc
toolkit/components/passwordmgr/test/browser/browser_context_menu.js
--- a/toolkit/components/passwordmgr/.eslintrc
+++ b/toolkit/components/passwordmgr/.eslintrc
@@ -1,10 +1,13 @@
 {
   "extends": "../../.eslintrc",
   "rules": {
+    // Require spacing around =>
+    "arrow-spacing": 2,
+
     // No space before always a space after a comma
     "comma-spacing": [2, {"before": false, "after": true}],
 
     // Commas at the end of the line not the start
     "comma-style": 2,
   }
 }
--- a/toolkit/components/passwordmgr/test/browser/browser_context_menu.js
+++ b/toolkit/components/passwordmgr/test/browser/browser_context_menu.js
@@ -134,17 +134,17 @@ add_task(function* test_context_menu_pas
 
       for (let passwordField of usernameInputList) {
         info("Testing password field: " + passwordField.id);
 
         let contextMenu = document.getElementById("contentAreaContextMenu");
         let menuItemStatus = form.getAttribute("menuitemStatus");
 
         // Synthesize a right mouse click over the username input element.
-        yield openPasswordContextMenu(browser, passwordField, ()=> {
+        yield openPasswordContextMenu(browser, passwordField, () => {
           let popupHeader = document.getElementById("fill-login");
 
           // If the password field is disabled or read-only, we want to see
           // the disabled Fill Password popup header.
           if (passwordField.disabled || passwordField.readOnly) {
             Assert.ok(!popupHeader.hidden, "Popup menu is not hidden.");
             Assert.ok(popupHeader.disabled, "Popup menu is disabled.");
             contextMenu.hidePopup();
@@ -190,17 +190,17 @@ add_task(function* test_context_menu_use
         // We always want to check if the first password field is filled,
         // since this is the current behavior from the _fillForm function.
         let passwordField = form.querySelector("input[type='password']");
 
         let contextMenu = document.getElementById("contentAreaContextMenu");
         let menuItemStatus = form.getAttribute("menuitemStatus");
 
         // Synthesize a right mouse click over the username input element.
-        yield openPasswordContextMenu(browser, usernameField, ()=> {
+        yield openPasswordContextMenu(browser, usernameField, () => {
           let popupHeader = document.getElementById("fill-login");
 
           // If we don't want to see the actual popup menu,
           // check if the popup is hidden or disabled.
           if (!passwordField || usernameField.disabled || usernameField.readOnly ||
               passwordField.disabled || passwordField.readOnly) {
             if (!passwordField) {
               Assert.ok(popupHeader.hidden, "Popup menu is hidden.");
@@ -343,17 +343,17 @@ function* assertContextMenuFill(form, us
 
   // If we have a password field, check if it's correctly filled
   if (passwordField && passwordField.getAttribute("expectedFail") == null) {
     Assert.equal(passwordField.value, login.password, "Password filled and correct.");
   }
 
   // Check that all fields that should not change have the same value as before.
   if (unchangedFields.length) {
-    Assert.ok(()=> {
+    Assert.ok(() => {
       for (let field of unchangedFields) {
         if (field.value != field.getAttribute("original-value")) {
           return false;
         }
       }
       return true;
     }, "Other fields were not changed.");
   }