Bug 1278138 - Enforce stricter eslint rules (arrow-spacing) on passwordmgr
MozReview-Commit-ID: D8djouoMxFy
--- 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.");
}