From 2a8983d76b5efde58067a0917bd653d9b58a3aae Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Fri, 2 Oct 2020 13:49:53 +0200 Subject: [PATCH] Enable the ESLint `no-var` rule in the `src/display/` folder Previously this rule has been enabled in the `web/` folder, and in select files in the `src/` sub-folders. Note that a number of the files in the `src/display/` folder were already enforcing the `no-var` rule, and thanks to Prettier the necessary re-writing will be (mostly) handled automatically. Please find additional details about the ESLint rule at https://eslint.org/docs/rules/no-var --- src/display/.eslintrc | 10 ++++++++++ src/display/annotation_layer.js | 1 - src/display/api.js | 1 - src/display/display_utils.js | 1 - src/display/fetch_stream.js | 1 - src/display/network.js | 1 - src/display/node_utils.js | 1 - src/display/svg.js | 1 - src/display/transport_stream.js | 1 - 9 files changed, 10 insertions(+), 8 deletions(-) create mode 100644 src/display/.eslintrc diff --git a/src/display/.eslintrc b/src/display/.eslintrc new file mode 100644 index 000000000..ab1c5afdf --- /dev/null +++ b/src/display/.eslintrc @@ -0,0 +1,10 @@ +{ + "extends": [ + "../../.eslintrc" + ], + + "rules": { + // ECMAScript 6 + "no-var": "error", + }, +} diff --git a/src/display/annotation_layer.js b/src/display/annotation_layer.js index 1664ac7d2..120586229 100644 --- a/src/display/annotation_layer.js +++ b/src/display/annotation_layer.js @@ -12,7 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* eslint no-var: error */ import { addLinkAttributes, diff --git a/src/display/api.js b/src/display/api.js index bb7b184a6..0c184d8b2 100644 --- a/src/display/api.js +++ b/src/display/api.js @@ -12,7 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* eslint no-var: error */ /** * @module pdfjsLib diff --git a/src/display/display_utils.js b/src/display/display_utils.js index 60f357e38..302dd0244 100644 --- a/src/display/display_utils.js +++ b/src/display/display_utils.js @@ -12,7 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* eslint no-var: error */ import { assert, diff --git a/src/display/fetch_stream.js b/src/display/fetch_stream.js index 38df650d4..2234f980c 100644 --- a/src/display/fetch_stream.js +++ b/src/display/fetch_stream.js @@ -12,7 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* eslint no-var: error */ import { AbortException, diff --git a/src/display/network.js b/src/display/network.js index fc4bf9f62..41ce45b4c 100644 --- a/src/display/network.js +++ b/src/display/network.js @@ -12,7 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* eslint no-var: error */ import { assert, diff --git a/src/display/node_utils.js b/src/display/node_utils.js index 32d49baa5..ad27906d0 100644 --- a/src/display/node_utils.js +++ b/src/display/node_utils.js @@ -13,7 +13,6 @@ * limitations under the License. */ /* globals __non_webpack_require__ */ -/* eslint no-var: error */ import { BaseCanvasFactory, BaseCMapReaderFactory } from "./display_utils.js"; import { isNodeJS } from "../shared/is_node.js"; diff --git a/src/display/svg.js b/src/display/svg.js index 412e27661..86206e645 100644 --- a/src/display/svg.js +++ b/src/display/svg.js @@ -13,7 +13,6 @@ * limitations under the License. */ /* globals __non_webpack_require__ */ -/* eslint no-var: error */ import { createObjectURL, diff --git a/src/display/transport_stream.js b/src/display/transport_stream.js index e6a93ab8a..b3625e3da 100644 --- a/src/display/transport_stream.js +++ b/src/display/transport_stream.js @@ -12,7 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* eslint no-var: error */ import { assert, createPromiseCapability } from "../shared/util.js";