mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-07 22:20:03 +00:00
[TS] Force explicit override & property access (#1006)
Enables TypeScript rules that improve code legibility.
- Requires `override` keyword
- Prevent indexed properties from being accessed with dot notation
```ts
const obj: Record<string, unknown> = {}
// Prefer
obj["property"]
// Over
obj.property
```
This commit is contained in:
@@ -61,9 +61,9 @@ export class LGraphGroup implements Positionable, IPinnable, IColorable {
|
||||
// TODO: Object instantiation pattern requires too much boilerplate and null checking. ID should be passed in via constructor.
|
||||
this.id = id ?? -1
|
||||
this.title = title || "Group"
|
||||
this.color = LGraphCanvas.node_colors.pale_blue
|
||||
? LGraphCanvas.node_colors.pale_blue.groupcolor
|
||||
: "#AAA"
|
||||
|
||||
const { pale_blue } = LGraphCanvas.node_colors
|
||||
this.color = pale_blue ? pale_blue.groupcolor : "#AAA"
|
||||
}
|
||||
|
||||
/** @inheritdoc {@link IColorable.setColorOption} */
|
||||
|
||||
Reference in New Issue
Block a user