Merge pull request #16517 from Snuffleupagus/eslint-import-more
Enable more `import` ESLint plugin rules
This commit is contained in:
commit
605d9f492f
@ -32,8 +32,14 @@
|
|||||||
|
|
||||||
"rules": {
|
"rules": {
|
||||||
// Plugins
|
// Plugins
|
||||||
|
"import/export": "error",
|
||||||
|
"import/exports-last": "error",
|
||||||
"import/extensions": ["error", "always", { "ignorePackages": true, }],
|
"import/extensions": ["error", "always", { "ignorePackages": true, }],
|
||||||
|
"import/first": "error",
|
||||||
"import/named": "error",
|
"import/named": "error",
|
||||||
|
"import/no-empty-named-blocks": "error",
|
||||||
|
"import/no-mutable-exports": "error",
|
||||||
|
"import/no-self-import": "error",
|
||||||
"import/no-unresolved": ["error", {
|
"import/no-unresolved": ["error", {
|
||||||
"ignore": ["pdfjs", "pdfjs-lib", "pdfjs-web", "web"]
|
"ignore": ["pdfjs", "pdfjs-lib", "pdfjs-web", "web"]
|
||||||
}],
|
}],
|
||||||
|
@ -69,24 +69,22 @@ const DEFAULT_RANGE_CHUNK_SIZE = 65536; // 2^16 = 65536
|
|||||||
const RENDERING_CANCELLED_TIMEOUT = 100; // ms
|
const RENDERING_CANCELLED_TIMEOUT = 100; // ms
|
||||||
const DELAYED_CLEANUP_TIMEOUT = 5000; // ms
|
const DELAYED_CLEANUP_TIMEOUT = 5000; // ms
|
||||||
|
|
||||||
let DefaultCanvasFactory = DOMCanvasFactory;
|
const DefaultCanvasFactory =
|
||||||
let DefaultCMapReaderFactory = DOMCMapReaderFactory;
|
typeof PDFJSDev !== "undefined" && PDFJSDev.test("GENERIC") && isNodeJS
|
||||||
let DefaultFilterFactory = DOMFilterFactory;
|
? require("./node_utils.js").NodeCanvasFactory
|
||||||
let DefaultStandardFontDataFactory = DOMStandardFontDataFactory;
|
: DOMCanvasFactory;
|
||||||
|
const DefaultCMapReaderFactory =
|
||||||
if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("GENERIC") && isNodeJS) {
|
typeof PDFJSDev !== "undefined" && PDFJSDev.test("GENERIC") && isNodeJS
|
||||||
const {
|
? require("./node_utils.js").NodeCMapReaderFactory
|
||||||
NodeCanvasFactory,
|
: DOMCMapReaderFactory;
|
||||||
NodeCMapReaderFactory,
|
const DefaultFilterFactory =
|
||||||
NodeFilterFactory,
|
typeof PDFJSDev !== "undefined" && PDFJSDev.test("GENERIC") && isNodeJS
|
||||||
NodeStandardFontDataFactory,
|
? require("./node_utils.js").NodeFilterFactory
|
||||||
} = require("./node_utils.js");
|
: DOMFilterFactory;
|
||||||
|
const DefaultStandardFontDataFactory =
|
||||||
DefaultCanvasFactory = NodeCanvasFactory;
|
typeof PDFJSDev !== "undefined" && PDFJSDev.test("GENERIC") && isNodeJS
|
||||||
DefaultCMapReaderFactory = NodeCMapReaderFactory;
|
? require("./node_utils.js").NodeStandardFontDataFactory
|
||||||
DefaultFilterFactory = NodeFilterFactory;
|
: DOMStandardFontDataFactory;
|
||||||
DefaultStandardFontDataFactory = NodeStandardFontDataFactory;
|
|
||||||
}
|
|
||||||
|
|
||||||
let createPDFNetworkStream;
|
let createPDFNetworkStream;
|
||||||
if (typeof PDFJSDev === "undefined") {
|
if (typeof PDFJSDev === "undefined") {
|
||||||
|
@ -28,6 +28,7 @@ import {
|
|||||||
import { isNodeJS } from "../shared/is_node.js";
|
import { isNodeJS } from "../shared/is_node.js";
|
||||||
|
|
||||||
/** @type {any} */
|
/** @type {any} */
|
||||||
|
// eslint-disable-next-line import/no-mutable-exports
|
||||||
let SVGGraphics = class {
|
let SVGGraphics = class {
|
||||||
constructor() {
|
constructor() {
|
||||||
unreachable("Not implemented: SVGGraphics");
|
unreachable("Not implemented: SVGGraphics");
|
||||||
|
Loading…
Reference in New Issue
Block a user