Enable the ESLint prefer-const rule globally (PR 11450 follow-up)

Please find additional details about the ESLint rule at https://eslint.org/docs/rules/prefer-const

With the recent introduction of Prettier this sort of mass enabling of ESLint rules becomes a lot easier, since the code will be automatically reformatted as necessary to account for e.g. changed line lengths.

Note that this patch is generated automatically, by using the ESLint `--fix` argument, and will thus require some additional clean-up (which is done separately).
This commit is contained in:
Jonas Jenwald 2020-01-24 09:48:21 +01:00
parent d2d9441373
commit 9e262ae7fa
54 changed files with 676 additions and 661 deletions

View file

@ -594,11 +594,11 @@ var renderTextLayer = (function renderTextLayerClosure() {
},
_render: function TextLayer_render(timeout) {
let capability = createPromiseCapability();
const capability = createPromiseCapability();
let styleCache = Object.create(null);
// The temporary canvas is used to measure text length in the DOM.
let canvas = document.createElement("canvas");
const canvas = document.createElement("canvas");
if (
typeof PDFJSDev === "undefined" ||
PDFJSDev.test("MOZCENTRAL || GENERIC")
@ -608,12 +608,12 @@ var renderTextLayer = (function renderTextLayerClosure() {
this._layoutTextCtx = canvas.getContext("2d", { alpha: false });
if (this._textContent) {
let textItems = this._textContent.items;
let textStyles = this._textContent.styles;
const textItems = this._textContent.items;
const textStyles = this._textContent.styles;
this._processItems(textItems, textStyles);
capability.resolve();
} else if (this._textContentStream) {
let pump = () => {
const pump = () => {
this._reader.read().then(({ value, done }) => {
if (done) {
capability.resolve();