From 744af9eeb8a244707cf73e74e88085c9ecafb927 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Thu, 7 May 2020 11:43:19 +0200 Subject: [PATCH] Enable the ESLint `grouped-accessor-pairs` rule This rule complements the existing `accessor-pairs` nicely, and ensures that a getter/setter pair is always consistently ordered. Please find additional details about this rule at https://eslint.org/docs/rules/grouped-accessor-pairs --- .eslintrc | 1 + examples/mobile-viewer/viewer.js | 8 ++++---- web/app.js | 8 ++++---- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.eslintrc b/.eslintrc index 972e2846c..acfef3008 100644 --- a/.eslintrc +++ b/.eslintrc @@ -77,6 +77,7 @@ "curly": ["error", "all"], "dot-notation": "error", "eqeqeq": ["error", "always"], + "grouped-accessor-pairs": ["error", "getBeforeSet"], "no-caller": "error", "no-else-return": "error", "no-empty-pattern": "error", diff --git a/examples/mobile-viewer/viewer.js b/examples/mobile-viewer/viewer.js index b79ceb321..d168ab0a1 100644 --- a/examples/mobile-viewer/viewer.js +++ b/examples/mobile-viewer/viewer.js @@ -312,14 +312,14 @@ var PDFViewerApplication = { return this.pdfDocument.numPages; }, - set page(val) { - this.pdfViewer.currentPageNumber = val; - }, - get page() { return this.pdfViewer.currentPageNumber; }, + set page(val) { + this.pdfViewer.currentPageNumber = val; + }, + zoomIn: function pdfViewZoomIn(ticks) { var newScale = this.pdfViewer.currentScale; do { diff --git a/web/app.js b/web/app.js index 669a3c6e3..4de56452c 100644 --- a/web/app.js +++ b/web/app.js @@ -531,14 +531,14 @@ const PDFViewerApplication = { return this.pdfDocument ? this.pdfDocument.numPages : 0; }, - set page(val) { - this.pdfViewer.currentPageNumber = val; - }, - get page() { return this.pdfViewer.currentPageNumber; }, + set page(val) { + this.pdfViewer.currentPageNumber = val; + }, + get printing() { return !!this.printService; },