Bug 1330791 - Enable the no-mixed-spaces-and-tabs rule and fix the associated errors. r?markh draft
authorJared Wein <jwein@mozilla.com>
Thu, 12 Jan 2017 17:24:41 -0500
changeset 462642 2998071bf4e1f9f8e234d99d7c014a773e4df9ad
parent 462514 e6b4394c33dfe577dbe742b5b0daf26b424c7c66
child 462643 ed1178f40c4cf4b841d6e29d7fbfc5b202378ffe
push id41837
push userjwein@mozilla.com
push dateTue, 17 Jan 2017 21:50:46 +0000
reviewersmarkh
bugs1330791
milestone53.0a1
Bug 1330791 - Enable the no-mixed-spaces-and-tabs rule and fix the associated errors. r?markh MozReview-Commit-ID: D1CTiez7BDy
services/.eslintrc.js
services/cloudsync/tests/xpcshell/test_bookmarks.js
--- a/services/.eslintrc.js
+++ b/services/.eslintrc.js
@@ -11,17 +11,16 @@ module.exports = {
     "brace-style": "warn",
     "consistent-return": "warn",
     "no-cond-assign": "warn",
     "no-else-return": "warn",
     "no-empty": "warn",
     "no-ex-assign": "warn",
     "no-func-assign": "warn",
     "no-irregular-whitespace": "warn",
-    "no-mixed-spaces-and-tabs": "warn",
     "no-native-reassign": "warn",
     "no-nested-ternary": "warn",
     "no-octal": "warn",
     "no-redeclare": "warn",
     "no-unreachable": "warn",
     "no-unsafe-finally": "warn",
     "no-unused-vars": "warn",
     "no-useless-call": "warn"
--- a/services/cloudsync/tests/xpcshell/test_bookmarks.js
+++ b/services/cloudsync/tests/xpcshell/test_bookmarks.js
@@ -1,73 +1,69 @@
 /* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
+* http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 Cu.import("resource://gre/modules/CloudSync.jsm");
 
 function run_test() {
   run_next_test();
 }
 
-function cleanup() {
-
-}
-
 add_task(function* test_merge_bookmarks_flat() {
   try {
-	  let rootFolder = yield CloudSync().bookmarks.getRootFolder("TEST");
-	  ok(rootFolder.id, "root folder id is ok");
+    let rootFolder = yield CloudSync().bookmarks.getRootFolder("TEST");
+    ok(rootFolder.id, "root folder id is ok");
 
-	  let items = [
-		{"id":"G_UL4ZhOyX8m", "type":rootFolder.BOOKMARK, "title":"reddit: the front page of the internet 1", "uri":"http://www.reddit.com", index:2},
-		{"id":"G_UL4ZhOyX8n", "type":rootFolder.BOOKMARK, "title":"reddit: the front page of the internet 2", "uri":"http://www.reddit.com?1", index:1},
-	  ];
-	  yield rootFolder.mergeRemoteItems(items);
+    let items = [
+      {"id":"G_UL4ZhOyX8m", "type":rootFolder.BOOKMARK, "title":"reddit: the front page of the internet 1", "uri":"http://www.reddit.com", index:2},
+      {"id":"G_UL4ZhOyX8n", "type":rootFolder.BOOKMARK, "title":"reddit: the front page of the internet 2", "uri":"http://www.reddit.com?1", index:1},
+    ];
+    yield rootFolder.mergeRemoteItems(items);
 
-	  let localItems = yield rootFolder.getLocalItems();
-	  equal(Object.keys(localItems).length, items.length, "found merged items");
+    let localItems = yield rootFolder.getLocalItems();
+    equal(Object.keys(localItems).length, items.length, "found merged items");
   } finally {
-  	yield CloudSync().bookmarks.deleteRootFolder("TEST");
+    yield CloudSync().bookmarks.deleteRootFolder("TEST");
   }
 });
 
 add_task(function* test_merge_bookmarks_in_folders() {
   try {
-	  let rootFolder = yield CloudSync().bookmarks.getRootFolder("TEST");
-	  ok(rootFolder.id, "root folder id is ok");
+    let rootFolder = yield CloudSync().bookmarks.getRootFolder("TEST");
+    ok(rootFolder.id, "root folder id is ok");
 
-	  let items = [
-	  	{"id":"G_UL4ZhOyX8m", "type":rootFolder.BOOKMARK, "title":"reddit: the front page of the internet 1", "uri":"http://www.reddit.com", index:2},
-	    {"id":"G_UL4ZhOyX8n", "type":rootFolder.BOOKMARK, parent:"G_UL4ZhOyX8x", "title":"reddit: the front page of the internet 2", "uri":"http://www.reddit.com/?a=å%20ä%20ö", index:1},
-	    {"id":"G_UL4ZhOyX8x", "type":rootFolder.FOLDER},
-	  ];
-	  yield rootFolder.mergeRemoteItems(items);
+    let items = [
+      {"id":"G_UL4ZhOyX8m", "type":rootFolder.BOOKMARK, "title":"reddit: the front page of the internet 1", "uri":"http://www.reddit.com", index:2},
+      {"id":"G_UL4ZhOyX8n", "type":rootFolder.BOOKMARK, parent:"G_UL4ZhOyX8x", "title":"reddit: the front page of the internet 2", "uri":"http://www.reddit.com/?a=å%20ä%20ö", index:1},
+      {"id":"G_UL4ZhOyX8x", "type":rootFolder.FOLDER},
+    ];
+    yield rootFolder.mergeRemoteItems(items);
 
-	  let localItems = yield rootFolder.getLocalItems();
-	  equal(localItems.length, items.length, "found merged items");
+    let localItems = yield rootFolder.getLocalItems();
+    equal(localItems.length, items.length, "found merged items");
 
-	  localItems.forEach(function(item) {
-	    ok(item.id == "G_UL4ZhOyX8m" ||
-	       item.id == "G_UL4ZhOyX8n" ||
-	       item.id == "G_UL4ZhOyX8x");
-	    if (item.id == "G_UL4ZhOyX8n") {
-	    	equal(item.parent, "G_UL4ZhOyX8x")
-	    } else {
-	    	equal(item.parent, rootFolder.id);
-	    }
-	  });
+    localItems.forEach(function(item) {
+      ok(item.id == "G_UL4ZhOyX8m" ||
+         item.id == "G_UL4ZhOyX8n" ||
+         item.id == "G_UL4ZhOyX8x");
+      if (item.id == "G_UL4ZhOyX8n") {
+        equal(item.parent, "G_UL4ZhOyX8x")
+      } else {
+        equal(item.parent, rootFolder.id);
+      }
+    });
 
-	  let folder = (yield rootFolder.getLocalItemsById(["G_UL4ZhOyX8x"]))[0];
-	  equal(folder.id, "G_UL4ZhOyX8x");
-	  equal(folder.type, rootFolder.FOLDER);
+    let folder = (yield rootFolder.getLocalItemsById(["G_UL4ZhOyX8x"]))[0];
+    equal(folder.id, "G_UL4ZhOyX8x");
+    equal(folder.type, rootFolder.FOLDER);
 
-	  let bookmark = (yield rootFolder.getLocalItemsById(["G_UL4ZhOyX8n"]))[0];
-	  equal(bookmark.id, "G_UL4ZhOyX8n");
-	  equal(bookmark.parent, "G_UL4ZhOyX8x");
-	  equal(bookmark.title, "reddit: the front page of the internet 2");
-	  equal(bookmark.index, 0);
-	  equal(bookmark.uri, "http://www.reddit.com/?a=%C3%A5%20%C3%A4%20%C3%B6");
+    let bookmark = (yield rootFolder.getLocalItemsById(["G_UL4ZhOyX8n"]))[0];
+    equal(bookmark.id, "G_UL4ZhOyX8n");
+    equal(bookmark.parent, "G_UL4ZhOyX8x");
+    equal(bookmark.title, "reddit: the front page of the internet 2");
+    equal(bookmark.index, 0);
+    equal(bookmark.uri, "http://www.reddit.com/?a=%C3%A5%20%C3%A4%20%C3%B6");
   } finally {
-	yield CloudSync().bookmarks.deleteRootFolder("TEST");
+    yield CloudSync().bookmarks.deleteRootFolder("TEST");
   }
 });