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:
parent
abb24f82fb
commit
c018070e80
15 changed files with 108 additions and 147 deletions
28
external/builder/builder.mjs
vendored
28
external/builder/builder.mjs
vendored
|
@ -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) {
|
||||
|
|
6
external/importL10n/locales.mjs
vendored
6
external/importL10n/locales.mjs
vendored
|
@ -100,10 +100,8 @@ function downloadLanguageFiles(root, langCode) {
|
|||
resolve();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (--downloadsLeft === 0) {
|
||||
resolve();
|
||||
}
|
||||
} else if (--downloadsLeft === 0) {
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue