Skip to content

Commit

Permalink
Merge pull request #17123 from Snuffleupagus/eslint-globals
Browse files Browse the repository at this point in the history
Update the ESLint `globals` list (PR 17055 follow-up)
  • Loading branch information
timvandermeij authored Oct 15, 2023
2 parents 76bf3da + 93f24dd commit a9a1195
Show file tree
Hide file tree
Showing 9 changed files with 7 additions and 11 deletions.
5 changes: 2 additions & 3 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,11 @@
"browser": true,
"es2022": true,
"worker": true,
"amd": true,
},

"globals": {
"PDFJSDev": false,
"exports": false,
"PDFJSDev": "readonly",
"__non_webpack_import__": "readonly",
},

"rules": {
Expand Down
2 changes: 1 addition & 1 deletion src/display/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand Down
1 change: 0 additions & 1 deletion src/display/node_stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* globals __non_webpack_import__ */

import {
AbortException,
Expand Down
1 change: 0 additions & 1 deletion src/display/node_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* globals __non_webpack_import__ */

import {
BaseCanvasFactory,
Expand Down
1 change: 1 addition & 0 deletions src/pdf.worker.entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion test/unit/node_stream_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
1 change: 0 additions & 1 deletion test/unit/test_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
4 changes: 2 additions & 2 deletions web/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -2268,15 +2268,15 @@ 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) {
const { debuggerScriptPath } = self.appConfig;
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;
}
Expand Down
2 changes: 1 addition & 1 deletion web/generic_scripting.js
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit a9a1195

Please sign in to comment.