Bug 1330791 - Enable the no-redeclare rule for eslint in /services and fix the associated errors. r?markh draft
authorJared Wein <jwein@mozilla.com>
Thu, 12 Jan 2017 18:19:47 -0500
changeset 460318 5bcfefdbda592d2946684b3a779ca490cadc3386
parent 460317 1355629c4787bd2e8e43f6b05b7f780d63202605
child 460319 f2e60a7301d7304b60420401b83b6e81e3fbea58
push id41370
push userbmo:jaws@mozilla.com
push dateThu, 12 Jan 2017 23:30:59 +0000
reviewersmarkh
bugs1330791
milestone53.0a1
Bug 1330791 - Enable the no-redeclare rule for eslint in /services and fix the associated errors. r?markh MozReview-Commit-ID: 7ADLmPB4eSu
services/.eslintrc.js
services/sync/tests/tps/test_bookmark_conflict.js
services/sync/tests/unit/test_utils_deriveKey.js
--- a/services/.eslintrc.js
+++ b/services/.eslintrc.js
@@ -11,11 +11,10 @@ module.exports = {
     "brace-style": "warn",
     "consistent-return": "warn",
     "no-cond-assign": "warn",
     "no-ex-assign": "warn",
     "no-func-assign": "warn",
     "no-native-reassign": "warn",
     "no-nested-ternary": "warn",
     "no-octal": "warn",
-    "no-redeclare": "warn",
   }
 };
--- a/services/sync/tests/tps/test_bookmark_conflict.js
+++ b/services/sync/tests/tps/test_bookmark_conflict.js
@@ -74,17 +74,17 @@ var bookmarkMods = {
     title: "Yahoo",
     changes: { location: "menu/folderd" }
   }],
 
   "menu/folderd": []
 };
 
 // a list of bookmarks to delete during a 'delete' action
-var bookmarksToDelete = {
+bookmarksToDelete = {
   "menu": [
     { folder: "foldera" },
     { folder: "folderb" },
   ],
   "menu/folderc": [
     { uri: "http://www.yahoo.com", title: "Yahoo" },
   ],
 };
--- a/services/sync/tests/unit/test_utils_deriveKey.js
+++ b/services/sync/tests/unit/test_utils_deriveKey.js
@@ -33,17 +33,17 @@ function run_test() {
       Utils.normalizePassphrase("9-5WMNU-95TQC-78Z2H-AMKBW-IZQZI")));
 
   // Base64. We don't actually use this in anger, particularly not with a 32-byte key.
   var der_key = Utils.deriveEncodedKeyFromPassphrase(der_passphrase, der_salt);
   _("Derived key in base64: " + der_key);
   do_check_eq(cryptoSvc.decrypt(cryptoSvc.encrypt("bacon", der_key, iv), der_key, iv), "bacon");
 
   // Base64, 16-byte output.
-  var der_key = Utils.deriveEncodedKeyFromPassphrase(der_passphrase, der_salt, 16);
+  der_key = Utils.deriveEncodedKeyFromPassphrase(der_passphrase, der_salt, 16);
   _("Derived key in base64: " + der_key);
   do_check_eq("d2zG0d2cBfXnRwMUGyMwyg==", der_key);
   do_check_eq(cryptoSvc.decrypt(cryptoSvc.encrypt("bacon", der_key, iv), der_key, iv), "bacon");
 
   // Base32. Again, specify '16' to avoid it generating a 256-bit key string.
   var b32key = Utils.derivePresentableKeyFromPassphrase(der_passphrase, der_salt, 16);
   var hyphenated = Utils.hyphenatePassphrase(b32key);
   do_check_true(Utils.isPassphrase(b32key));