mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-23 08:38:06 +02:00
Migrate to ESLint flat config
Flat config is the new config system used by ESLint 9. To make the migration easier, they also added flat config support to ESLint 8. This commit migrates the various ESLint configs in the repository to use the new system, **without** upgrading to ESLint 9 yet.
This commit is contained in:
parent
7a962031e9
commit
9e6ff979db
16 changed files with 450 additions and 387 deletions
|
@ -48,11 +48,9 @@ class ImageResizer {
|
|||
return shadow(
|
||||
this,
|
||||
"canUseImageDecoder",
|
||||
// eslint-disable-next-line no-undef
|
||||
this.#isChrome || typeof ImageDecoder === "undefined"
|
||||
? Promise.resolve(false)
|
||||
: // eslint-disable-next-line no-undef
|
||||
ImageDecoder.isTypeSupported("image/bmp")
|
||||
: ImageDecoder.isTypeSupported("image/bmp")
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -185,7 +183,6 @@ class ImageResizer {
|
|||
let decoder, imagePromise;
|
||||
|
||||
if (await ImageResizer.canUseImageDecoder) {
|
||||
// eslint-disable-next-line no-undef
|
||||
decoder = new ImageDecoder({
|
||||
data,
|
||||
type: "image/bmp",
|
||||
|
|
|
@ -36,11 +36,9 @@ class JpegStream extends DecodeStream {
|
|||
return shadow(
|
||||
this,
|
||||
"canUseImageDecoder",
|
||||
// eslint-disable-next-line no-undef
|
||||
typeof ImageDecoder === "undefined"
|
||||
? Promise.resolve(false)
|
||||
: // eslint-disable-next-line no-undef
|
||||
ImageDecoder.isTypeSupported("image/jpeg")
|
||||
: ImageDecoder.isTypeSupported("image/jpeg")
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -163,7 +161,6 @@ class JpegStream extends DecodeStream {
|
|||
if (!JpegImage.canUseImageDecoder(data, jpegOptions.colorTransform)) {
|
||||
return null;
|
||||
}
|
||||
// eslint-disable-next-line no-undef
|
||||
decoder = new ImageDecoder({
|
||||
data,
|
||||
type: "image/jpeg",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue