Enable the ESLint prefer-const rule in the web/ directory

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

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 2019-12-27 00:22:32 +01:00
parent 9c767e3875
commit 5d14e68bec
36 changed files with 367 additions and 367 deletions

View file

@ -103,14 +103,14 @@ class PDFRenderingQueue {
* 2. if last scrolled down, the page after the visible pages, or
* if last scrolled up, the page before the visible pages
*/
let visibleViews = visible.views;
const visibleViews = visible.views;
let numVisible = visibleViews.length;
const numVisible = visibleViews.length;
if (numVisible === 0) {
return null;
}
for (let i = 0; i < numVisible; ++i) {
let view = visibleViews[i].view;
const view = visibleViews[i].view;
if (!this.isViewFinished(view)) {
return view;
}
@ -118,13 +118,13 @@ class PDFRenderingQueue {
// All the visible views have rendered; try to render next/previous pages.
if (scrolledDown) {
let nextPageIndex = visible.last.id;
const nextPageIndex = visible.last.id;
// IDs start at 1, so no need to add 1.
if (views[nextPageIndex] && !this.isViewFinished(views[nextPageIndex])) {
return views[nextPageIndex];
}
} else {
let previousPageIndex = visible.first.id - 2;
const previousPageIndex = visible.first.id - 2;
if (
views[previousPageIndex] &&
!this.isViewFinished(views[previousPageIndex])