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

@ -125,7 +125,9 @@ function bundle(filename, outfilename, pathPrefix, initFiles, amdName, defines,
// readDependencies returns AMD module names: removing 'pdfjs' prefix and
// adding '.js' extensions to the name.
var umd = require('./external/umdutils/verifier.js');
initFiles = initFiles.map(function (p) { return pathPrefix + p; });
initFiles = initFiles.map(function (p) {
return pathPrefix + p;
});
var files = umd.readDependencies(initFiles).loadOrder.map(function (name) {
return pathPrefix + name.replace(/^[\w\-]+\//, '') + '.js';
});
@ -166,7 +168,9 @@ function bundle(filename, outfilename, pathPrefix, initFiles, amdName, defines,
var templateContent = fs.readFileSync(filename).toString();
templateContent = templateContent.replace(
/\/\/#expand\s+__BUNDLE__\s*\n/, function (all) { return bundleContent; });
/\/\/#expand\s+__BUNDLE__\s*\n/, function (all) {
return bundleContent;
});
bundleContent = null;
templateContent = p2.preprocessPDFJSCode(ctx, templateContent);