1
0
Fork 0
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:
Nicolò Ribaudo 2024-11-12 13:00:27 +01:00
parent 7a962031e9
commit 9e6ff979db
No known key found for this signature in database
GPG key ID: AAFDA9101C58F338
16 changed files with 450 additions and 387 deletions

View file

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

View file

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