Bug 1294542 - Enable the block-spacing rule for eslint. r=felipe

MozReview-Commit-ID: GDfvwWRLNm5
This commit is contained in:
Jared Wein 2016-08-16 21:27:37 -04:00
parent c66c2fee3a
commit ea0b3d77bc
27 changed files with 49 additions and 47 deletions

View File

@ -150,7 +150,7 @@ var healthReportWrapper = {
initRemotePage: function () {
let iframe = document.getElementById("remote-report").contentDocument;
iframe.addEventListener("RemoteHealthReportCommand",
function onCommand(e) {healthReportWrapper.handleRemoteCommand(e);},
function onCommand(e) { healthReportWrapper.handleRemoteCommand(e); },
false);
healthReportWrapper.updatePrefState();
},

View File

@ -72,7 +72,7 @@ function synthesizeDragWithDirection(aElement, aExpectedDragData, aDirection, aC
aCallback()
}, false);
var prevent = function(aEvent) {aEvent.preventDefault();}
var prevent = function(aEvent) { aEvent.preventDefault(); }
var xIncrement = 0;
var yIncrement = 0;

View File

@ -46,7 +46,7 @@ function initTest() {
"Browser:Cookies", "", {});
// when it has loaded, run actual tests
cmd.addEventListener("load", function() {executeSoon(function() {runTest(cmd, searchTerm, vals.length, matches);});}, false);
cmd.addEventListener("load", function() { executeSoon(function() { runTest(cmd, searchTerm, vals.length, matches); }); }, false);
}
function isDisabled(win, expectation) {

View File

@ -91,8 +91,8 @@ add_task(function* testSyncedTabsSidebarList() {
SyncedTabs._internal = {
isConfiguredToSyncTabs: true,
hasSyncedThisSession: true,
getTabClients() { return Promise.resolve([])},
syncTabs() {return Promise.resolve();},
getTabClients() { return Promise.resolve([]) },
syncTabs() { return Promise.resolve(); },
};
sinon.stub(syncedTabsDeckComponent, "_accountStatus", () => Promise.resolve(true));
@ -144,8 +144,8 @@ add_task(function* testSyncedTabsSidebarFilteredList() {
SyncedTabs._internal = {
isConfiguredToSyncTabs: true,
hasSyncedThisSession: true,
getTabClients() { return Promise.resolve([])},
syncTabs() {return Promise.resolve();},
getTabClients() { return Promise.resolve([]) },
syncTabs() { return Promise.resolve(); },
};
sinon.stub(syncedTabsDeckComponent, "_accountStatus", () => Promise.resolve(true));
@ -204,7 +204,7 @@ add_task(function* testSyncedTabsSidebarStatus() {
isConfiguredToSyncTabs: false,
hasSyncedThisSession: false,
getTabClients() {},
syncTabs() {return Promise.resolve();},
syncTabs() { return Promise.resolve(); },
};
Assert.ok(syncedTabsDeckComponent, "component exists");
@ -266,8 +266,8 @@ add_task(function* testSyncedTabsSidebarContextMenu() {
SyncedTabs._internal = {
isConfiguredToSyncTabs: true,
hasSyncedThisSession: true,
getTabClients() { return Promise.resolve([])},
syncTabs() {return Promise.resolve();},
getTabClients() { return Promise.resolve([]) },
syncTabs() { return Promise.resolve(); },
};
sinon.stub(syncedTabsDeckComponent, "_accountStatus", () => Promise.resolve(true));

View File

@ -1438,7 +1438,7 @@ add_task(function* test_DirectoryLinksProvider_getFrequencyCapLogic() {
// now step into the furture
let _wasTodayOrig = DirectoryLinksProvider._wasToday;
DirectoryLinksProvider._wasToday = function () {return false;}
DirectoryLinksProvider._wasToday = function () { return false; }
// exhaust total views
DirectoryLinksProvider._addFrequencyCapView("1")
do_check_true(DirectoryLinksProvider._testFrequencyCapLimits("1"));
@ -1487,7 +1487,7 @@ add_task(function* test_DirectoryLinksProvider_getFrequencyCapReportSiteAction()
targetedSite: "foo.com",
url: "bar.com"
},
isPinned: function() {return false;},
isPinned: function() { return false; },
}], "view", 0);
// read file content and ensure that view counters are updated
@ -1531,9 +1531,9 @@ add_task(function* test_DirectoryLinksProvider_ClickRemoval() {
}]
},
{
handleError: function () {do_check_true(false);},
handleError: function () { do_check_true(false); },
handleResult: function () {},
handleCompletion: function () {resolve();}
handleCompletion: function () { resolve(); }
}
);
});
@ -1828,7 +1828,7 @@ add_task(function* test_blockSuggestedTiles() {
// block suggested tile in a regular way
DirectoryLinksProvider.reportSitesAction([{
isPinned: function() {return false;},
isPinned: function() { return false; },
link: Object.assign({frecency: 1000}, suggestedLink)
}], "block", 0);

View File

@ -9,7 +9,7 @@
"arrow-spacing": 2,
// Always require spacing around a single line block
// "block-spacing": 1,
"block-spacing": 2,
// No newline before open brace for a block
// "brace-style": 2,

View File

@ -130,7 +130,7 @@ let tabFinder = {
function wait(ms = 0) {
try {
let resolve;
let p = new Promise(resolve_ => {resolve = resolve_});
let p = new Promise(resolve_ => { resolve = resolve_ });
setTimeout(resolve, ms);
return p;
} catch (e) {

View File

@ -40,7 +40,7 @@ function test_portal_not_found() {
do_check_eq(++step, 2);
do_check_true(success);
do_check_eq(attempt, 1);
gServer.stop(function() {dump('server stop\n'); do_test_finished(); });
gServer.stop(function() { dump('server stop\n'); do_test_finished(); });
}
};

View File

@ -228,7 +228,7 @@ ContentPrefService.prototype = {
if (this._privModeStorage.has(group, aName)) {
let value = this._privModeStorage.get(group, aName);
if (aCallback) {
this._scheduleCallback(function() {aCallback.onResult(value);});
this._scheduleCallback(function() { aCallback.onResult(value); });
return undefined;
}
return value;
@ -597,7 +597,7 @@ ContentPrefService.prototype = {
if (this._cache.has(aGroup, aSetting)) {
value = this._cache.get(aGroup, aSetting);
if (aCallback) {
this._scheduleCallback(function() {aCallback.onResult(value);});
this._scheduleCallback(function() { aCallback.onResult(value); });
return undefined;
}
return value;
@ -647,7 +647,7 @@ ContentPrefService.prototype = {
if (this._cache.has(null, aName)) {
value = this._cache.get(null, aName);
if (aCallback) {
this._scheduleCallback(function() {aCallback.onResult(value);});
this._scheduleCallback(function() { aCallback.onResult(value); });
return undefined;
}
return value;

View File

@ -2652,7 +2652,7 @@ function run_single_closure_tests(library, abi, suffix)
// mismatch with the cx stashed in the closure.
try {
var sb = Components.utils.Sandbox("http://www.example.com");
sb.fn = fn_v_t(function() {sb.foo = {};});
sb.fn = fn_v_t(function() { sb.foo = {}; });
Components.utils.evalInSandbox("fn();", sb);
} catch (e) {} // Components not available in workers.

View File

@ -26,9 +26,9 @@ var rejectsTreeView = {
}
return rv;
},
isSeparator : function(index) {return false;},
isSeparator : function(index) { return false; },
isSorted: function() { return false; },
isContainer : function(index) {return false;},
isContainer : function(index) { return false; },
cycleHeader : function(column) {},
getRowProperties : function(row) { return ""; },
getColumnProperties : function(column) { return ""; },

View File

@ -43,11 +43,11 @@ function burnCPOW() {
let gBurnCPOW = null;
function burnContentCPU() {
setTimeout(() => {try {
setTimeout(() => { try {
gBurnContentCPU()
} catch (ex) {
dump(`test-addon error: ${ex}\n`);
}}, 0);
} }, 0);
}
let gBurnContentCPU = null;

View File

@ -184,7 +184,7 @@ add_task(function* test_insert_multiple_error_cases() {
add_task(function* test_history_insertMany() {
const BAD_URLS = ["about:config", "chrome://browser/content/browser.xul"];
const GOOD_URLS = [1, 2, 3].map(x => {return `http://mozilla.com/${x}`;});
const GOOD_URLS = [1, 2, 3].map(x => { return `http://mozilla.com/${x}`; });
let makePageInfos = Task.async(function*(urls, filter = x => x) {
let pageInfos = [];

View File

@ -76,7 +76,7 @@ var containers = [
/* eslint-enable comma-spacing */
var visibleContainers = containers.filter(
function(aContainer) {return aContainer.visible});
function(aContainer) { return aContainer.visible });
/**
* Asynchronous task that fills history and checks containers' labels.

View File

@ -442,7 +442,7 @@ add_task(function* test_getLivemark_removeItem_contention() {
PlacesUtils.livemarks.addLivemark({ title: "test"
, parentGuid: PlacesUtils.bookmarks.unfiledGuid
, feedURI: FEED_URI
}).catch(() => {/* swallow errors*/});
}).catch(() => { /* swallow errors*/ });
yield PlacesUtils.bookmarks.eraseEverything();
let livemark = yield PlacesUtils.livemarks.addLivemark(
{ title: "test"

View File

@ -142,7 +142,7 @@ function onCancel ()
try {
printProgress.processCanceledByUser = true;
}
catch (e) {return true;}
catch (e) { return true; }
// don't Close up dialog by returning false, the backend will close the dialog when everything will be aborted.
return false;

View File

@ -244,7 +244,7 @@ function onLoad() {
// Set up dialog button callbacks.
var object = this;
doSetOKCancel("", function () { return object.onCancel();});
doSetOKCancel("", function () { return object.onCancel(); });
// Fill dialog.
loadDialog();
@ -278,7 +278,7 @@ function onCancel ()
{
printProgress.processCanceledByUser = true;
}
catch ( exception ) {return true;}
catch ( exception ) { return true; }
// don't Close up dialog by returning false, the backend will close the dialog when everything will be aborted.
return false;

View File

@ -110,14 +110,14 @@ var view = {
},
selectionChanged : function() {},
cycleCell: function(row, col) {},
isEditable: function(row, col) {return false; },
isSelectable: function(row, col) {return false; },
isEditable: function(row, col) { return false; },
isSelectable: function(row, col) { return false; },
setCellValue: function(row, col, value) {},
setCellText: function(row, col, value) {},
performAction: function(action) {},
performActionOnRow: function(action, row) {},
performActionOnCell: function(action, row, col) {},
isSeparator: function(index) {return false; }
isSeparator: function(index) { return false; }
};
// find the index in gPrefView of a pref object

View File

@ -491,10 +491,10 @@ var gViewSourceUtils = {
}
},
onLocationChange: function() {return 0;},
onProgressChange: function() {return 0;},
onStatusChange: function() {return 0;},
onSecurityChange: function() {return 0;},
onLocationChange: function() { return 0; },
onProgressChange: function() { return 0; },
onStatusChange: function() { return 0; },
onSecurityChange: function() { return 0; },
webShell: null,
editor: null,

View File

@ -492,7 +492,7 @@ this.CrashSubmit = {
let [dump, extra, mem] = getPendingMinidump(id);
return OS.File.open(dump.path + ".ignore", {create: true},
{unixFlags: OS.Constants.libc.O_CREAT})
.then((file) => {file.close(); });
.then((file) => { file.close(); });
},
/**

View File

@ -18,7 +18,7 @@ var ProductAddonCheckerScope = Cu.import("resource://gre/modules/addons/ProductA
do_get_profile();
function run_test() {Cu.import("resource://gre/modules/Preferences.jsm")
function run_test() { Cu.import("resource://gre/modules/Preferences.jsm")
Preferences.set("media.gmp.log.dump", true);
Preferences.set("media.gmp.log.level", 0);
run_next_test();

View File

@ -1,6 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/* eslint-disable block-spacing */
var {utils: Cu} = Components;
Cu.import("resource://gre/modules/NetUtil.jsm");

View File

@ -948,7 +948,7 @@ tests.push(
}, null);
do_print("Setting wait for second promise");
return promise2.catch(error => {return 3;})
return promise2.catch(error => { return 3; })
.then(
count => {
shouldExitNestedEventLoop = true;
@ -1074,7 +1074,7 @@ make_promise_test(function test_caught_is_not_reported() {
let promise = wait_for_uncaught([salt], 500);
(function() {
let uncaught = Promise.reject("This error, on the other hand, is caught " + salt);
uncaught.catch(function() { /* ignore rejection */});
uncaught.catch(function() { /* ignore rejection */ });
uncaught = null;
})();
// Isolate this in a function to increase likelihood that the gc will

View File

@ -217,7 +217,7 @@ this.DeferredSave.prototype = {
return;
}
writing.then(null, error => {return 0;})
writing.then(null, error => { return 0; })
.then(count => {
this.logger.debug("Starting write");
this.totalSaves++;

View File

@ -168,7 +168,7 @@ function WebAPITask(apiRequest, apiArgs, processor) {
Addon.prototype = {
uninstall: WebAPITask("addonUninstall", function() { return [this.id]; }),
setEnabled: WebAPITask("addonSetEnabled", function(value) {return [this.id, value]; }),
setEnabled: WebAPITask("addonSetEnabled", function(value) { return [this.id, value]; }),
};
const INSTALL_EVENTS = [

View File

@ -392,7 +392,7 @@ function check_test_pt1() {
do_throw("Addon " + (i + 1) + " did not get installed correctly");
}
do_execute_soon(function checkstate1() {check_state("start", null, run_test_pt2);});
do_execute_soon(function checkstate1() { check_state("start", null, run_test_pt2); });
});
}

View File

@ -183,7 +183,7 @@ function check_test_1() {
do_check_eq(a1.icon64URL, uri + "icon64.png");
a1.uninstall();
do_execute_soon(function() {run_test_2(a1)});
do_execute_soon(function() { run_test_2(a1) });
});
});
}));