diff --git a/.eslintrc b/.eslintrc index 3e5732b18..7be8629f3 100644 --- a/.eslintrc +++ b/.eslintrc @@ -22,12 +22,11 @@ "browser": true, "es2022": true, "worker": true, - "amd": true, }, "globals": { - "PDFJSDev": false, - "exports": false, + "PDFJSDev": "readonly", + "__non_webpack_import__": "readonly", }, "rules": { diff --git a/src/display/api.js b/src/display/api.js index 96f1ee7ea..4cd74a301 100644 --- a/src/display/api.js +++ b/src/display/api.js @@ -2306,7 +2306,7 @@ class PDFWorker { const worker = typeof PDFJSDev === "undefined" ? await import("pdfjs/pdf.worker.js") - : await __non_webpack_import__(this.workerSrc); // eslint-disable-line no-undef + : await __non_webpack_import__(this.workerSrc); return worker.WorkerMessageHandler; }; diff --git a/src/display/node_stream.js b/src/display/node_stream.js index ea182fff3..185557282 100644 --- a/src/display/node_stream.js +++ b/src/display/node_stream.js @@ -12,7 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* globals __non_webpack_import__ */ import { AbortException, diff --git a/src/display/node_utils.js b/src/display/node_utils.js index c436a6435..643d3f4d3 100644 --- a/src/display/node_utils.js +++ b/src/display/node_utils.js @@ -12,7 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* globals __non_webpack_import__ */ import { BaseCanvasFactory, diff --git a/src/pdf.worker.entry.js b/src/pdf.worker.entry.js index e9709b4b5..c717a1418 100644 --- a/src/pdf.worker.entry.js +++ b/src/pdf.worker.entry.js @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +/* globals require:readonly */ /* eslint-disable import/no-commonjs */ (typeof window !== "undefined" diff --git a/test/unit/node_stream_spec.js b/test/unit/node_stream_spec.js index a538bf1ab..919fc63dd 100644 --- a/test/unit/node_stream_spec.js +++ b/test/unit/node_stream_spec.js @@ -12,7 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* globals __non_webpack_import__ */ import { AbortException, isNodeJS } from "../../src/shared/util.js"; import { PDFNodeStream } from "../../src/display/node_stream.js"; diff --git a/test/unit/test_utils.js b/test/unit/test_utils.js index 8ff955c2b..111c05006 100644 --- a/test/unit/test_utils.js +++ b/test/unit/test_utils.js @@ -12,7 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* globals __non_webpack_import__ */ import { NullStream, StringStream } from "../../src/core/stream.js"; import { Page, PDFDocument } from "../../src/core/document.js"; diff --git a/web/app.js b/web/app.js index 876e23490..2749168be 100644 --- a/web/app.js +++ b/web/app.js @@ -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; } diff --git a/web/generic_scripting.js b/web/generic_scripting.js index 8b7f33305..600fb4905 100644 --- a/web/generic_scripting.js +++ b/web/generic_scripting.js @@ -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());