mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-23 08:38:06 +02:00
Merge pull request #19042 from Snuffleupagus/eslint-no-console
Enable the ESLint `no-console` rule in parts of the code-base
This commit is contained in:
commit
15a5e47e64
6 changed files with 17 additions and 3 deletions
|
@ -413,6 +413,7 @@ function noContextMenu(e) {
|
|||
|
||||
// Deprecated API function -- display regardless of the `verbosity` setting.
|
||||
function deprecated(details) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log("Deprecated API usage: " + details);
|
||||
}
|
||||
|
||||
|
|
|
@ -166,7 +166,7 @@ class ImageManager {
|
|||
}
|
||||
data.refCounter = 1;
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
warn(e);
|
||||
data = null;
|
||||
}
|
||||
this.#cache.set(key, data);
|
||||
|
|
|
@ -84,6 +84,7 @@ class Sandbox {
|
|||
[buf, this._alertOnError]
|
||||
);
|
||||
} catch (error) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(error);
|
||||
} finally {
|
||||
if (buf) {
|
||||
|
|
|
@ -363,6 +363,7 @@ function getVerbosityLevel() {
|
|||
// end users.
|
||||
function info(msg) {
|
||||
if (verbosity >= VerbosityLevel.INFOS) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`Info: ${msg}`);
|
||||
}
|
||||
}
|
||||
|
@ -370,6 +371,7 @@ function info(msg) {
|
|||
// Non-fatal warnings.
|
||||
function warn(msg) {
|
||||
if (verbosity >= VerbosityLevel.WARNINGS) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`Warning: ${msg}`);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue