Adjust the brace-style ESLint rule to disallow single lines (and also enable no-iterator)

See http://eslint.org/docs/rules/brace-style.
Having the opening/closing braces on the same line can often make the code slightly more difficult to read, in particular for `if`/`else if` statements, compared to using new lines.

This patch also, for consistency with `mozilla-central`, enables the [`no-iterator`](http://eslint.org/docs/rules/no-iterator) rule. Note that this rule didn't require a single code change.
This commit is contained in:
Jonas Jenwald 2017-02-03 12:58:08 +01:00
parent 92e5fb099e
commit bc736fdc7d
18 changed files with 129 additions and 46 deletions

View file

@ -84,7 +84,9 @@ function createExtensionGlobal() {
// Network-related mocks.
window.Request = {};
window.Request.prototype = {
get mode() { throw new TypeError('Illegal invocation'); },
get mode() {
throw new TypeError('Illegal invocation');
},
};
window.fetch = function(url, options) {
assert.equal(url, LOG_URL);
@ -339,7 +341,9 @@ var tests = [
var window = createExtensionGlobal();
var didWarn = false;
window.console = {};
window.console.warn = function() { didWarn = true; };
window.console.warn = function() {
didWarn = true;
};
window.chrome.runtime.id = 'abcdefghijklmnopabcdefghijklmnop';
telemetryScript.runInNewContext(window);
assert.deepEqual(window.test_requests, []);
@ -373,7 +377,9 @@ var tests = [
function test_fetch_mode_not_supported() {
var window = createExtensionGlobal();
delete window.Request.prototype.mode;
window.fetch = function() { throw new Error('Unexpected call to fetch!'); };
window.fetch = function() {
throw new Error('Unexpected call to fetch!');
};
telemetryScript.runInNewContext(window);
assert.deepEqual(window.test_requests, [{
'Deduplication-Id': '4242424242',