1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 06:38:07 +02:00

Enable the no-lonely-if ESLint rule

These changes were mostly done automatically, using `gulp lint --fix`, and only a few spots with comments needed manual tweaking; please see https://eslint.org/docs/latest/rules/no-lonely-if
This commit is contained in:
Jonas Jenwald 2023-07-20 10:57:30 +02:00
parent abb24f82fb
commit c018070e80
15 changed files with 108 additions and 147 deletions

View file

@ -198,21 +198,19 @@ function preprocess(inFilename, outFilename, defines) {
}
break;
}
} else {
if (state === STATE_NONE) {
writeLine(line);
} else if (
(state === STATE_IF_TRUE || state === STATE_ELSE_TRUE) &&
!stack.includes(STATE_IF_FALSE) &&
!stack.includes(STATE_ELSE_FALSE)
) {
writeLine(
line
.replaceAll(/^\/\/|^<!--/g, " ")
.replaceAll(/(^\s*)\/\*/g, "$1 ")
.replaceAll(/\*\/$|-->$/g, "")
);
}
} else if (state === STATE_NONE) {
writeLine(line);
} else if (
(state === STATE_IF_TRUE || state === STATE_ELSE_TRUE) &&
!stack.includes(STATE_IF_FALSE) &&
!stack.includes(STATE_ELSE_FALSE)
) {
writeLine(
line
.replaceAll(/^\/\/|^<!--/g, " ")
.replaceAll(/(^\s*)\/\*/g, "$1 ")
.replaceAll(/\*\/$|-->$/g, "")
);
}
}
if (state !== STATE_NONE || stack.length !== 0) {

View file

@ -100,10 +100,8 @@ function downloadLanguageFiles(root, langCode) {
resolve();
}
});
} else {
if (--downloadsLeft === 0) {
resolve();
}
} else if (--downloadsLeft === 0) {
resolve();
}
});
});