Enforce curly braces in multi-line if statements (#619)

Removes formatters' ability to print code that goes to a new line, but
uses no braces to delineate.

It becomes more difficult to follow when using JS-style indents (two
spaces).

No effort required - braces added by auto-fixer.
This commit is contained in:
filtered
2025-02-27 02:08:23 +11:00
committed by GitHub
parent a43109d58a
commit 0e9b8b03b7
8 changed files with 57 additions and 34 deletions

View File

@@ -1213,8 +1213,9 @@ export class LGraphNode implements Positionable, IPinnable, IColorable {
!output ||
output.type !== LiteGraph.EVENT ||
(action && output.name != action)
)
) {
continue
}
this.triggerSlot(i, param, null, options)
}
}
@@ -1893,8 +1894,9 @@ export class LGraphNode implements Positionable, IPinnable, IColorable {
(widget.disabled && !includeDisabled) ||
widget.hidden ||
(widget.advanced && !this.showAdvanced)
)
) {
continue
}
const h = widget.computeSize
? widget.computeSize(nodeWidth)[1]
@@ -1903,8 +1905,9 @@ export class LGraphNode implements Positionable, IPinnable, IColorable {
if (
widget.last_y !== undefined &&
isInRectangle(x, y, 6, widget.last_y, w - 12, h)
)
) {
return widget
}
}
return null
}
@@ -2972,14 +2975,14 @@ export class LGraphNode implements Positionable, IPinnable, IColorable {
}
ctx.fillStyle = this.renderingBoxColor
if (low_quality)
if (low_quality) {
ctx.fillRect(
title_height * 0.5 - box_size * 0.5,
title_height * -0.5 - box_size * 0.5,
box_size,
box_size,
)
else {
} else {
ctx.beginPath()
ctx.arc(
title_height * 0.5,