From 2db75a2a3a6d71f9ecc14a9e13671f3dc0e55df9 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Wed, 3 Jan 2018 13:15:19 +0100 Subject: [PATCH] Update the ESLint dependencies, and also tweak the `no-multiple-empty-lines` rules Since multiple empty lines is virtually unused in the code-base, and the few cases that do exist look like "typos", let's enforce greater consistency here; please see https://eslint.org/docs/rules/no-multiple-empty-lines. --- .eslintrc | 2 +- extensions/firefox/tools/l10n.js | 1 - package.json | 6 +++--- src/core/cff_parser.js | 1 - src/core/evaluator.js | 1 - src/core/font_renderer.js | 1 - src/display/pattern_helper.js | 1 - src/display/webgl.js | 1 - test/unit/function_spec.js | 1 - test/webbrowser.js | 1 - web/pdf_print_service.js | 1 - 11 files changed, 4 insertions(+), 13 deletions(-) diff --git a/.eslintrc b/.eslintrc index 03de9c912..488426187 100644 --- a/.eslintrc +++ b/.eslintrc @@ -124,7 +124,7 @@ "new-cap": ["error", { "newIsCap": true, "capIsNew": false, }], "new-parens": "error", "no-array-constructor": "error", - "no-multiple-empty-lines": ["error", { "max": 2, "maxEOF": 0, "maxBOF": 1, }], + "no-multiple-empty-lines": ["error", { "max": 1, "maxEOF": 0, "maxBOF": 1, }], "no-new-object": "error", "no-tabs": "error", "no-trailing-spaces": ["error", { "skipBlankLines": false, }], diff --git a/extensions/firefox/tools/l10n.js b/extensions/firefox/tools/l10n.js index 7b362d257..35bdbe457 100644 --- a/extensions/firefox/tools/l10n.js +++ b/extensions/firefox/tools/l10n.js @@ -76,7 +76,6 @@ } } - // translate an HTML subtree function translateFragment(element) { element = element || document.querySelector("html"); diff --git a/package.json b/package.json index 2075ad1f7..1b3f29cc8 100644 --- a/package.json +++ b/package.json @@ -9,9 +9,9 @@ "babel-preset-env": "^1.6.0", "core-js": "^2.5.1", "escodegen": "^1.9.0", - "eslint": "^4.10.0", - "eslint-plugin-mozilla": "^0.4.9", - "eslint-plugin-no-unsanitized": "^2.0.1", + "eslint": "^4.14.0", + "eslint-plugin-mozilla": "^0.5.0", + "eslint-plugin-no-unsanitized": "^2.0.2", "fancy-log": "^1.3.2", "gulp": "^3.9.1", "gulp-rename": "^1.2.2", diff --git a/src/core/cff_parser.js b/src/core/cff_parser.js index 8335b8fcc..da5df8cad 100644 --- a/src/core/cff_parser.js +++ b/src/core/cff_parser.js @@ -96,7 +96,6 @@ var CFFStandardStrings = [ 'Black', 'Bold', 'Book', 'Light', 'Medium', 'Regular', 'Roman', 'Semibold' ]; - var CFFParser = (function CFFParserClosure() { var CharstringValidationData = [ null, diff --git a/src/core/evaluator.js b/src/core/evaluator.js index e056ebd94..876f40ea1 100644 --- a/src/core/evaluator.js +++ b/src/core/evaluator.js @@ -1351,7 +1351,6 @@ var PartialEvaluator = (function PartialEvaluatorClosure() { textContentItem.textRunBreakAllowed = false; } - textContentItem.initialized = true; return textContentItem; } diff --git a/src/core/font_renderer.js b/src/core/font_renderer.js index 15d12b836..4cf3902d0 100644 --- a/src/core/font_renderer.js +++ b/src/core/font_renderer.js @@ -676,7 +676,6 @@ var FontRendererFactory = (function FontRendererFactoryClosure() { }, }); - return { create: function FontRendererFactory_create(font, seacAnalysisEnabled) { var data = new Uint8Array(font.data); diff --git a/src/display/pattern_helper.js b/src/display/pattern_helper.js index 00fa3ce51..6d0859f45 100644 --- a/src/display/pattern_helper.js +++ b/src/display/pattern_helper.js @@ -251,7 +251,6 @@ ShadingIRs.Mesh = { } } - // Rasterizing on the main thread since sending/queue large canvases // might cause OOM. var temporaryPatternCanvas = createMeshCanvas(bounds, scale, coords, diff --git a/src/display/webgl.js b/src/display/webgl.js index 33eba1ef3..2722a0f36 100644 --- a/src/display/webgl.js +++ b/src/display/webgl.js @@ -219,7 +219,6 @@ var WebGLUtils = (function WebGLUtilsClosure() { var texture = createTexture(gl, layer, gl.TEXTURE0); var maskTexture = createTexture(gl, mask, gl.TEXTURE1); - // Create a buffer and put a single clipspace rectangle in // it (2 triangles) var buffer = gl.createBuffer(); diff --git a/test/unit/function_spec.js b/test/unit/function_spec.js index d1868a2a2..7d2c9d809 100644 --- a/test/unit/function_spec.js +++ b/test/unit/function_spec.js @@ -440,7 +440,6 @@ describe('function', function() { }); }); - describe('PostScriptCompiler', function() { function check(code, domain, range, samples) { var compiler = new PostScriptCompiler(); diff --git a/test/webbrowser.js b/test/webbrowser.js index 58f7193ae..3e9a5280c 100644 --- a/test/webbrowser.js +++ b/test/webbrowser.js @@ -261,5 +261,4 @@ WebBrowser.create = function (desc) { return new WebBrowser(name, path); }; - exports.WebBrowser = WebBrowser; diff --git a/web/pdf_print_service.js b/web/pdf_print_service.js index 0a536da41..21988a73f 100644 --- a/web/pdf_print_service.js +++ b/web/pdf_print_service.js @@ -200,7 +200,6 @@ PDFPrintService.prototype = { }, }; - let print = window.print; window.print = function print() { if (activeService) {