From 79f20f09cbb33f691b30008b1ca0414f03d531c1 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 6 Oct 2017 10:36:45 -0400 Subject: [PATCH] lint fixes --- src/background.js | 21 ++++++--------------- src/scripts/analytics.js | 2 +- src/scripts/u2f.js | 2 ++ src/services/autofillService.js | 4 ++++ src/services/cryptoService.js | 2 ++ src/services/folderService.js | 2 ++ src/services/lockService.js | 2 +- src/services/loginService.js | 2 ++ 8 files changed, 20 insertions(+), 17 deletions(-) diff --git a/src/background.js b/src/background.js index 05d7ae279b..a9357bc9b8 100644 --- a/src/background.js +++ b/src/background.js @@ -631,6 +631,8 @@ var bg_isBackground = true, var tabDomain = bg_utilsService.getDomain(tab.url); if (tabDomain && tabDomain === loginToAdd.domain) { bg_loginsToAdd.splice(i, 1); + + /* jshint ignore:start */ bg_loginService.encrypt({ id: null, folderId: null, @@ -649,6 +651,8 @@ var bg_isBackground = true, }); }); }); + /* jshint ignore:end */ + messageTab(tab.id, 'closeNotificationBar'); } } @@ -671,11 +675,8 @@ var bg_isBackground = true, } } - function checkbg_loginsToAdd(tab, callback) { + function checkbg_loginsToAdd(tab) { if (!bg_loginsToAdd.length) { - if (callback) { - callback(); - } return; } @@ -693,17 +694,11 @@ var bg_isBackground = true, function check() { if (!tab) { - if (callback) { - callback(); - } return; } var tabDomain = bg_utilsService.getDomain(tab.url); if (!tabDomain) { - if (callback) { - callback(); - } return; } @@ -711,11 +706,7 @@ var bg_isBackground = true, if (bg_loginsToAdd[i].tabId === tab.id && bg_loginsToAdd[i].domain === tabDomain) { messageTab(tab.id, 'openNotificationBar', { type: 'add' - }, function () { - if (callback) { - callback(); - } - }); + }, function () { }); break; } } diff --git a/src/scripts/analytics.js b/src/scripts/analytics.js index 4094b8a8a3..1210bdf82b 100644 --- a/src/scripts/analytics.js +++ b/src/scripts/analytics.js @@ -41,7 +41,7 @@ if (paramIndex > -1) { pagePath = pagePath.substring(0, paramIndex); } - return encodeURIComponent(pagePath) + return encodeURIComponent(pagePath); } bgPage.bg_appIdService.getAnonymousAppId(function (gaAnonAppId) { diff --git a/src/scripts/u2f.js b/src/scripts/u2f.js index 81a831c281..e2fbce2569 100644 --- a/src/scripts/u2f.js +++ b/src/scripts/u2f.js @@ -11,7 +11,9 @@ var thisU2f = null; U2f.prototype.init = function (data) { + /* jshint ignore:start */ var self = thisU2f = this; + /* jshint ignore:end */ self.connectorLink.href = self.webVaultUrl + '/u2f-connector.html' + '?data=' + this.base64Encode(JSON.stringify(data)) + diff --git a/src/services/autofillService.js b/src/services/autofillService.js index 8e52a202d8..16d0f2bbf1 100644 --- a/src/services/autofillService.js +++ b/src/services/autofillService.js @@ -240,13 +240,17 @@ function initAutofill() { totpPromise = self.totpService.isAutoCopyEnabled().then(function (enabled) { if (enabled) { + /* jshint ignore:start */ return self.totpService.getCode(login.totp); + /* jshint ignore:end */ } return null; }).then(function (code) { if (code) { + /* jshint ignore:start */ self.utilsService.copyToClipboard(code); + /* jshint ignore:end */ } return code; diff --git a/src/services/cryptoService.js b/src/services/cryptoService.js index cb78b26a7c..c655690053 100644 --- a/src/services/cryptoService.js +++ b/src/services/cryptoService.js @@ -220,6 +220,7 @@ function initCryptoService(constantsService) { var decPromises = []; for (var orgId in obj.encOrgKeys) { if (obj.encOrgKeys.hasOwnProperty(orgId)) { + /* jshint ignore:start */ (function (orgIdInstance) { var promise = self.rsaDecrypt(obj.encOrgKeys[orgIdInstance]).then(function (decValueB64) { orgKeys[orgIdInstance] = new SymmetricCryptoKey(decValueB64, true); @@ -229,6 +230,7 @@ function initCryptoService(constantsService) { }); decPromises.push(promise); })(orgId); + /* jshint ignore:end */ } } diff --git a/src/services/folderService.js b/src/services/folderService.js index 06f16927ef..e6c2d3b8f4 100644 --- a/src/services/folderService.js +++ b/src/services/folderService.js @@ -87,9 +87,11 @@ function initFolderService() { }]; self.getAll(function (folders) { for (var i = 0; i < folders.length; i++) { + /* jshint ignore:start */ promises.push(folders[i].decrypt().then(function (folder) { decFolders.push(folder); })); + /* jshint ignore:end */ } Q.all(promises).then(function () { diff --git a/src/services/lockService.js b/src/services/lockService.js index 7322b372ef..3c128d7bb0 100644 --- a/src/services/lockService.js +++ b/src/services/lockService.js @@ -144,5 +144,5 @@ function initLockService(self) { } return null; - }; + } } diff --git a/src/services/loginService.js b/src/services/loginService.js index af1f09cd30..44ba67219f 100644 --- a/src/services/loginService.js +++ b/src/services/loginService.js @@ -172,9 +172,11 @@ function initLoginService() { var decLogins = []; self.getAll(function (logins) { for (var i = 0; i < logins.length; i++) { + /* jshint ignore:start */ promises.push(logins[i].decrypt().then(function (login) { decLogins.push(login); })); + /* jshint ignore:end */ } Q.all(promises).then(function () {