Bug 1386283 - Enable eslint 'indent' rule on passwordmgr with --fix. r=mconley

ignore-this-changeset for blame

Differential Revision: https://phabricator.services.mozilla.com/D16109

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Matthew Noorenberghe 2019-01-10 19:26:17 +00:00
parent d9469a1400
commit 3f7baf5de6
53 changed files with 2124 additions and 2127 deletions

View File

@ -7,6 +7,24 @@ module.exports = {
// be removed & synced with the mozilla/recommended value.
"complexity": ["error", 56],
"indent": ["error", 2, {
ignoredNodes: ["ConditionalExpression"],
ArrayExpression: "first",
SwitchCase: 1,
CallExpression: {
arguments: "first",
},
FunctionExpression: {
parameters: "first",
},
FunctionDeclaration: {
parameters: "first",
},
MemberExpression: "off",
ObjectExpression: "first",
outerIIFEBody: 0,
}],
"no-unused-vars": ["error", {"args": "none", "vars": "local", "varsIgnorePattern": "^(ids|ignored|unused)$"}],
}
};

View File

@ -1078,8 +1078,7 @@ LoginManagerPrompter.prototype = {
this._getLocalizedString("notifyBarRememberPasswordButtonAccessKey");
var displayHost = this._getShortDisplayHost(aLogin.hostname);
var notificationText = this._getLocalizedString(
"rememberPasswordMsgNoUsername",
var notificationText = this._getLocalizedString("rememberPasswordMsgNoUsername",
[displayHost]);
// Notification is a PopupNotification
@ -1166,23 +1165,17 @@ LoginManagerPrompter.prototype = {
var dialogText;
if (aLogin.username) {
var displayUser = this._sanitizeUsername(aLogin.username);
dialogText = this._getLocalizedString(
"rememberPasswordMsg",
dialogText = this._getLocalizedString("rememberPasswordMsg",
[displayUser, displayHost]);
} else {
dialogText = this._getLocalizedString(
"rememberPasswordMsgNoUsername",
dialogText = this._getLocalizedString("rememberPasswordMsgNoUsername",
[displayHost]);
}
var dialogTitle = this._getLocalizedString(
"savePasswordTitle");
var neverButtonText = this._getLocalizedString(
"neverForSiteButtonText");
var rememberButtonText = this._getLocalizedString(
"rememberButtonText");
var notNowButtonText = this._getLocalizedString(
"notNowButtonText");
var dialogTitle = this._getLocalizedString("savePasswordTitle");
var neverButtonText = this._getLocalizedString("neverForSiteButtonText");
var rememberButtonText = this._getLocalizedString("rememberButtonText");
var notNowButtonText = this._getLocalizedString("notNowButtonText");
this.log("Prompting user to save/ignore login");
var userChoice = Services.prompt.confirmEx(this._chromeWindow,
@ -1306,15 +1299,12 @@ LoginManagerPrompter.prototype = {
var dialogText;
if (aOldLogin.username)
dialogText = this._getLocalizedString(
"updatePasswordMsg",
dialogText = this._getLocalizedString("updatePasswordMsg",
[aOldLogin.username]);
else
dialogText = this._getLocalizedString(
"updatePasswordMsgNoUser");
dialogText = this._getLocalizedString("updatePasswordMsgNoUser");
var dialogTitle = this._getLocalizedString(
"passwordChangeTitle");
var dialogTitle = this._getLocalizedString("passwordChangeTitle");
// returns 0 for yes, 1 for no.
var ok = !Services.prompt.confirmEx(this._chromeWindow,

View File

@ -13,8 +13,7 @@ add_task(async function setup() {
add_task(async function test_empty_password() {
await BrowserTestUtils.withNewTab({
gBrowser,
url: "https://example.com/browser/toolkit/components/" +
"passwordmgr/test/browser/form_basic.html",
url: "https://example.com/browser/toolkit/components/passwordmgr/test/browser/form_basic.html",
}, async function(browser) {
// Submit the form in the content page with the credentials from the test
// case. This will cause the doorhanger notification to be displayed.
@ -51,8 +50,7 @@ add_task(async function test_empty_password() {
add_task(async function test_toggle_password() {
await BrowserTestUtils.withNewTab({
gBrowser,
url: "https://example.com/browser/toolkit/components/" +
"passwordmgr/test/browser/form_basic.html",
url: "https://example.com/browser/toolkit/components/passwordmgr/test/browser/form_basic.html",
}, async function(browser) {
// Submit the form in the content page with the credentials from the test
// case. This will cause the doorhanger notification to be displayed.
@ -89,8 +87,7 @@ add_task(async function test_toggle_password() {
add_task(async function test_checkbox_disabled_if_has_master_password() {
await BrowserTestUtils.withNewTab({
gBrowser,
url: "https://example.com/browser/toolkit/components/" +
"passwordmgr/test/browser/form_basic.html",
url: "https://example.com/browser/toolkit/components/passwordmgr/test/browser/form_basic.html",
}, async function(browser) {
// Submit the form in the content page with the credentials from the test
// case. This will cause the doorhanger notification to be displayed.

View File

@ -19,11 +19,8 @@
// Class monitoring number of open dialog windows
// It checks there is always open just a single dialog per application
function dialogMonitor() {
// eslint-disable-next-line mozilla/use-services
var observerService = SpecialPowers.Cc["@mozilla.org/observer-service;1"]
.getService(Ci.nsIObserverService);
observerService.addObserver(this, "domwindowopened");
observerService.addObserver(this, "domwindowclosed");
SpecialPowers.Services.obs.addObserver(this, "domwindowopened");
SpecialPowers.Services.obs.addObserver(this, "domwindowclosed");
}
/*
@ -57,11 +54,8 @@
},
shutdown() {
// eslint-disable-next-line mozilla/use-services
var observerService = SpecialPowers.Cc["@mozilla.org/observer-service;1"]
.getService(Ci.nsIObserverService);
observerService.removeObserver(this, "domwindowopened");
observerService.removeObserver(this, "domwindowclosed");
SpecialPowers.Services.obs.removeObserver(this, "domwindowopened");
SpecialPowers.Services.obs.removeObserver(this, "domwindowclosed");
},
reset() {
@ -85,8 +79,7 @@
logins.push(login);
}
var mozproxy = "moz-proxy://" +
SpecialPowers.wrap(pi).host + ":" +
var mozproxy = "moz-proxy://" + SpecialPowers.wrap(pi).host + ":" +
SpecialPowers.wrap(pi).port;
addLogin(mozproxy, "proxy_realm",

View File

@ -44,8 +44,7 @@ function reloadStorage(aInputPathName, aInputFileName)
{
var inputFile = null;
if (aInputFileName) {
inputFile = Cc["@mozilla.org/file/local;1"].
createInstance(Ci.nsIFile);
inputFile = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
inputFile.initWithPath(aInputPathName);
inputFile.append(aInputFileName);
}