Whitelist closure related cases to address the remaining no-shadow linting errors

Given the way that "classes" were previously implemented in PDF.js, using regular functions and closures, there's a fair number of false positives when the `no-shadow` ESLint rule was enabled.

Note that while *some* of these `eslint-disable` statements can be removed if/when the relevant code is converted to proper `class`es, we'll probably never be able to get rid of all of them given our naming/coding conventions (however I don't really see this being a problem).
This commit is contained in:
Jonas Jenwald 2020-03-25 10:15:50 +01:00
parent 1d2f787d6a
commit dcb16af968
32 changed files with 109 additions and 0 deletions

View file

@ -420,6 +420,7 @@ const PDFDocumentLoadingTask = (function PDFDocumentLoadingTaskClosure() {
* (such as network requests) and provides a way to listen for completion,
* after which individual pages can be rendered.
*/
// eslint-disable-next-line no-shadow
class PDFDocumentLoadingTask {
constructor() {
this._capability = createPromiseCapability();
@ -1679,6 +1680,7 @@ const PDFWorker = (function PDFWorkerClosure() {
* thread to the worker thread and vice versa. If the creation of a web
* worker is not possible, a "fake" worker will be used instead.
*/
// eslint-disable-next-line no-shadow
class PDFWorker {
/**
* @param {PDFWorkerParameters} params - Worker initialization parameters.
@ -2700,6 +2702,7 @@ class RenderTask {
const InternalRenderTask = (function InternalRenderTaskClosure() {
const canvasInRendering = new WeakSet();
// eslint-disable-next-line no-shadow
class InternalRenderTask {
constructor({
callback,