1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Enable the ESLint no-debugger and no-alert rules

The `debugger`-statement would only, potentially, make sense during development and we thus want to prevent it from being accidentally included when landing code.
The `alert`, `confirm`, and `prompt` functions should generally be avoided, with the few intended cases manually allowed.

Please find additional details about the ESLint rules at:
 - https://eslint.org/docs/rules/no-debugger
 - https://eslint.org/docs/rules/no-alert
This commit is contained in:
Jonas Jenwald 2020-10-05 13:30:20 +02:00
parent b3e32e2001
commit ba079453bf
4 changed files with 5 additions and 0 deletions

View file

@ -1667,6 +1667,7 @@ const PDFViewerApplication = {
"Warning: The PDF is not fully loaded for printing."
)
.then(notReadyMessage => {
// eslint-disable-next-line no-alert
window.alert(notReadyMessage);
});
return;

View file

@ -219,6 +219,7 @@ function requestAccessToLocalFile(fileUrl, overlayManager, callback) {
"\nSelected: " +
file.name +
"\nDo you want to open the selected file?";
// eslint-disable-next-line no-alert
if (!confirm(msg)) {
this.value = "";
return;