1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

Update the ESLint globals list (PR 17055 follow-up)

Given that we only use standard `import`/`export` statements now, after recent PRs, the "exports" global is unused.
Instead we add "__non_webpack_import__" to the `globals` to avoid having to sprinkle disable statements throughout the code.

Finally, the way that `globals` are defined has changed in ESLint and we should thus explicitly specify them as "readonly"; please find additional details at https://eslint.org/docs/latest/use/configure/language-options#specifying-globals
This commit is contained in:
Jonas Jenwald 2023-10-15 11:29:53 +02:00
parent 5c45dfa0ae
commit d5acbbccd3
8 changed files with 6 additions and 10 deletions

View file

@ -2268,7 +2268,7 @@ async function loadFakeWorker() {
globalThis.pdfjsWorker = await import("pdfjs/pdf.worker.js");
return;
}
await __non_webpack_import__(PDFWorker.workerSrc); // eslint-disable-line no-undef
await __non_webpack_import__(PDFWorker.workerSrc);
}
async function loadPDFBug(self) {
@ -2276,7 +2276,7 @@ async function loadPDFBug(self) {
const { PDFBug } =
typeof PDFJSDev === "undefined"
? await import(debuggerScriptPath) // eslint-disable-line no-unsanitized/method
: await __non_webpack_import__(debuggerScriptPath); // eslint-disable-line no-undef
: await __non_webpack_import__(debuggerScriptPath);
self._PDFBug = PDFBug;
}

View file

@ -45,7 +45,7 @@ class GenericScripting {
const sandbox =
typeof PDFJSDev === "undefined"
? import(sandboxBundleSrc) // eslint-disable-line no-unsanitized/method
: __non_webpack_import__(sandboxBundleSrc); // eslint-disable-line no-undef
: __non_webpack_import__(sandboxBundleSrc);
sandbox
.then(pdfjsSandbox => {
resolve(pdfjsSandbox.QuickJSSandbox());