1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 10:08:06 +02:00

Enable the unicorn/prefer-logical-operator-over-ternary ESLint plugin rule

This leads to ever so slightly more compact code, and can in some cases remove the need for a temporary variable.

Please find additional information here:
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-logical-operator-over-ternary.md
This commit is contained in:
Jonas Jenwald 2022-07-12 10:52:37 +02:00
parent aa6512e70f
commit dcc73423e5
5 changed files with 13 additions and 15 deletions

View file

@ -247,7 +247,7 @@ function layoutNode(node, availableSpace) {
}
}
const maxWidth = (!node.w ? availableSpace.width : node.w) - marginH;
const maxWidth = (node.w || availableSpace.width) - marginH;
const fontFinder = node[$globalData].fontFinder;
if (
node.value.exData &&

View file

@ -457,7 +457,7 @@ class Arc extends XFAObject {
}
[$toHTML]() {
const edge = this.edge ? this.edge : new Edge({});
const edge = this.edge || new Edge({});
const edgeStyle = edge[$toStyle]();
const style = Object.create(null);
if (this.fill && this.fill.presence === "visible") {
@ -3650,7 +3650,7 @@ class Line extends XFAObject {
[$toHTML]() {
const parent = this[$getParent]()[$getParent]();
const edge = this.edge ? this.edge : new Edge({});
const edge = this.edge || new Edge({});
const edgeStyle = edge[$toStyle]();
const style = Object.create(null);
const thickness = edge.presence === "visible" ? edge.thickness : 0;