1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 10:08:06 +02:00

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

@ -66,7 +66,9 @@ function flatten(stats) {
});
// Use only overall results if not grouped by 'stat'
if (options.groupBy.indexOf('stat') < 0) {
rows = rows.filter(function(s) { return s.stat === 'Overall'; });
rows = rows.filter(function(s) {
return s.stat === 'Overall';
});
}
return rows;
}
@ -129,7 +131,9 @@ function stat(baseline, current) {
}
var i, row, rows = [];
// collect rows and measure column widths
var width = labels.map(function(s) { return s.length; });
var width = labels.map(function(s) {
return s.length;
});
rows.push(labels);
for (var k = 0; k < keys.length; k++) {
var key = keys[k];
@ -157,7 +161,9 @@ function stat(baseline, current) {
}
// add horizontal line
var hline = width.map(function(w) { return new Array(w + 1).join('-'); });
var hline = width.map(function(w) {
return new Array(w + 1).join('-');
});
rows.splice(1, 0, hline);
// print output