Merge pull request #17123 from Snuffleupagus/eslint-globals

Update the ESLint `globals` list (PR 17055 follow-up)
This commit is contained in:
Tim van der Meij 2023-10-15 12:06:54 +02:00 committed by GitHub
commit a9a1195582
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 7 additions and 11 deletions

View File

@ -22,12 +22,11 @@
"browser": true,
"es2022": true,
"worker": true,
"amd": true,
},
"globals": {
"PDFJSDev": false,
"exports": false,
"PDFJSDev": "readonly",
"__non_webpack_import__": "readonly",
},
"rules": {

View File

@ -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;
};

View File

@ -12,7 +12,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* globals __non_webpack_import__ */
import {
AbortException,

View File

@ -12,7 +12,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* globals __non_webpack_import__ */
import {
BaseCanvasFactory,

View File

@ -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"

View File

@ -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";

View File

@ -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";

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());