Skip to content

Commit 447890f

Browse files
committed
Make linter happy
1 parent a0e3638 commit 447890f

5 files changed

Lines changed: 27 additions & 13 deletions

File tree

src/elements/noflo-editor.js

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,10 @@ export class FlowEditor extends HTMLElement {
504504
if (this.selectedNodes.has(other)) continue;
505505
const otherPos = other.position;
506506
if (
507-
Math.max(Math.abs(newX - otherPos.x), Math.abs(newY - otherPos.y)) < other.size
507+
Math.max(
508+
Math.abs(newX - otherPos.x),
509+
Math.abs(newY - otherPos.y),
510+
) < other.size
508511
) {
509512
collision = true;
510513
break;
@@ -530,7 +533,11 @@ export class FlowEditor extends HTMLElement {
530533
this.longPressTimer = null;
531534
}
532535
this.updateWireDrag(e);
533-
} else if (!this.isPanning && !this.isDraggingNode && !this.isDraggingWire) {
536+
} else if (
537+
!this.isPanning &&
538+
!this.isDraggingNode &&
539+
!this.isDraggingWire
540+
) {
534541
// Hover state
535542
const interest = this.getInterestArea(e.clientX, e.clientY);
536543
if (interest.type !== FlowEditor.INTEREST_AREA_TYPES.NONE) {
@@ -801,7 +808,11 @@ export class FlowEditor extends HTMLElement {
801808
text: "Add Node",
802809
onClick: () => {
803810
const graphPos = this.viewportToGraph(x, y);
804-
this.addNode(`Node_${Date.now().toString().slice(-4)}`, graphPos.x, graphPos.y);
811+
this.addNode(
812+
`Node_${Date.now().toString().slice(-4)}`,
813+
graphPos.x,
814+
graphPos.y,
815+
);
805816
},
806817
icon: "plus",
807818
});
@@ -958,7 +969,7 @@ export class FlowEditor extends HTMLElement {
958969
this.emitSelectionChanged();
959970
}
960971

961-
handleEdgeSelection(e, edgeElement, isMultiple) {
972+
handleEdgeSelection(_e, edgeElement, isMultiple) {
962973
const edge = this.edges.find(
963974
(edge) => edge.hitPath === edgeElement || edge.visualPath === edgeElement,
964975
);
@@ -989,7 +1000,7 @@ export class FlowEditor extends HTMLElement {
9891000
this.emitSelectionChanged();
9901001
}
9911002

992-
startNodeDrag(e, node) {
1003+
startNodeDrag(_e, _node) {
9931004
// This method is now deprecated in favor of handleNodeSelection
9941005
}
9951006

@@ -1169,7 +1180,7 @@ export class FlowEditor extends HTMLElement {
11691180
// No overlap if max(|dx|, |dy|) >= max(node.size, size)
11701181
if (
11711182
Math.max(Math.abs(snapped.x - pos.x), Math.abs(snapped.y - pos.y)) <
1172-
Math.max(node.size, size)
1183+
Math.max(node.size, size)
11731184
) {
11741185
return false;
11751186
}
@@ -1403,7 +1414,7 @@ export class FlowEditor extends HTMLElement {
14031414
}
14041415

14051416
getInterestArea(clientX, clientY) {
1406-
const rect = this.viewport.getBoundingClientRect();
1417+
const _rect = this.viewport.getBoundingClientRect();
14071418

14081419
// 2. Check Dynamic Areas
14091420
// We check these in order of priority.

src/elements/noflo-node.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export class FlowNode extends HTMLElement {
6666
connectedCallback() {
6767
const sizeAttr = this.getAttribute("size");
6868
if (sizeAttr) {
69-
this.size = parseInt(sizeAttr);
69+
this.size = parseInt(sizeAttr, 10);
7070
}
7171
this.render();
7272
}

src/elements/noflo-radial-menu.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,11 @@ export class FlowRadialMenu extends HTMLElement {
152152
};
153153
window.addEventListener("pointermove", this._moveMenuListener);
154154

155-
this._releaseMenuListener = (e) => {
155+
this._releaseMenuListener = (_e) => {
156156
const highlighted = this.menuElement.querySelector(
157157
".context-menu-item.highlighted",
158158
);
159-
if (highlighted && highlighted._item) {
159+
if (highlighted?._item) {
160160
const item = highlighted._item;
161161
this.close(); // Close first to avoid any event conflicts
162162
item.onClick();
@@ -232,7 +232,7 @@ export class FlowRadialMenu extends HTMLElement {
232232
);
233233
let availIdx = 0;
234234

235-
this._items.forEach((item, index) => {
235+
this._items.forEach((_item, index) => {
236236
if (itemAngles[index] === undefined) {
237237
if (availIdx < availableSections.length) {
238238
const section = availableSections[availIdx++];

src/elements/noflo-selection-pills.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export class SelectionPills extends HTMLElement {
1717
return ["nodes-count", "edges-count"];
1818
}
1919

20-
attributeChangedCallback(name, oldValue, newValue) {
20+
attributeChangedCallback(_name, oldValue, newValue) {
2121
if (oldValue !== newValue) {
2222
this.updatePills();
2323
}

src/main.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,10 @@ async function init() {
186186
if (Math.random() > 0.5 || edges.length === 0) {
187187
// Random node activity
188188
const node = nodes[Math.floor(Math.random() * nodes.length)];
189-
editor.recordActivity(node.position.x + node.size / 2, node.position.y + node.size / 2);
189+
editor.recordActivity(
190+
node.position.x + node.size / 2,
191+
node.position.y + node.size / 2,
192+
);
190193
} else {
191194
// Random edge activity (sampled point along the wire)
192195
const edge = edges[Math.floor(Math.random() * edges.length)];

0 commit comments

Comments
 (0)