mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 22:58:07 +02:00
Enable the ESLint no-console
rule in parts of the code-base
The purpose of these changes is to make it more difficult to accidentally include logging statements, used during development and debugging, when submitting patches for review. For (almost) all code residing in the `src/` folder we should use our existing helper functions to ensure that all logging can be controlled via the `verbosity` API-option. For the `test/unit/` respectively `test/integration/` folders we shouldn't need any "normal" logging, but it should be OK to print the *occasional* warning/error message. Please find additional details about the ESLint rule at https://eslint.org/docs/latest/rules/no-console
This commit is contained in:
parent
9bf9bbda0b
commit
af3c1f2a0d
6 changed files with 17 additions and 3 deletions
|
@ -309,9 +309,11 @@ async function waitForEvent({
|
|||
|
||||
const success = await awaitPromise(handle);
|
||||
if (success === null) {
|
||||
console.log(`waitForEvent: ${eventName} didn't trigger within the timeout`);
|
||||
console.warn(
|
||||
`waitForEvent: ${eventName} didn't trigger within the timeout`
|
||||
);
|
||||
} else if (!success) {
|
||||
console.log(`waitForEvent: ${eventName} triggered, but validation failed`);
|
||||
console.warn(`waitForEvent: ${eventName} triggered, but validation failed`);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue