[nit] Add consistent method chaining linter (#613)

Enforces that chained accessed should **either** all be on one line, or
all on individual lines (same as imports).
This commit is contained in:
filtered
2025-02-26 21:11:11 +11:00
committed by GitHub
parent 5cdd0581fa
commit 867b9ed316
5 changed files with 51 additions and 13 deletions

View File

@@ -2138,8 +2138,7 @@ export class LGraphNode implements Positionable, IPinnable, IColorable {
// Empty string and * match anything (type: 0)
if (type == "" || type == "*") type = 0
const sourceTypes = String(type).toLowerCase()
.split(",")
const sourceTypes = String(type).toLowerCase().split(",")
// Run the search
let occupiedSlot: number | TSlot | null = null
@@ -2147,8 +2146,7 @@ export class LGraphNode implements Positionable, IPinnable, IColorable {
const slot: TSlot & IGenericLinkOrLinks = slots[i]
const destTypes = slot.type == "0" || slot.type == "*"
? ["0"]
: String(slot.type).toLowerCase()
.split(",")
: String(slot.type).toLowerCase().split(",")
for (const sourceType of sourceTypes) {
// TODO: Remove _event_ entirely.

View File

@@ -100,8 +100,10 @@ export class Reroute implements Positionable, LinkSegment, Serialisable<Serialis
const nextId = this.linkIds.values().next().value
return nextId === undefined
? undefined
: this.#network.deref()
?.links.get(nextId)
: this.#network
.deref()
?.links
.get(nextId)
?.origin_id
}
@@ -110,8 +112,10 @@ export class Reroute implements Positionable, LinkSegment, Serialisable<Serialis
const nextId = this.linkIds.values().next().value
return nextId === undefined
? undefined
: this.#network.deref()
?.links.get(nextId)
: this.#network
.deref()
?.links
.get(nextId)
?.origin_slot
}
@@ -209,7 +213,8 @@ export class Reroute implements Positionable, LinkSegment, Serialisable<Serialis
return this.#network
.deref()
?.reroutes.get(this.#parentId)
?.reroutes
.get(this.#parentId)
?.findNextReroute(withParentId, visited)
}