From 318cdee15cd427ac379e47f7f95b52b2f7830bab Mon Sep 17 00:00:00 2001 From: Jan-Henrik Bruhn Date: Sat, 24 Jan 2026 16:05:50 +0100 Subject: [PATCH] Fix lint errors: change @ts-ignore to @ts-expect-error and fix type assertions --- src/utils/edgeUtils.ts | 4 ++-- src/utils/handleMigration.ts | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/utils/edgeUtils.ts b/src/utils/edgeUtils.ts index e9b7053..14a8c3a 100644 --- a/src/utils/edgeUtils.ts +++ b/src/utils/edgeUtils.ts @@ -191,9 +191,9 @@ function getNodeIntersection( ): { x: number; y: number; angle: number } { // Use positionAbsolute for correct positioning of nodes inside groups // positionAbsolute accounts for parent group offset, while position is relative - // @ts-ignore - internals.positionAbsolute exists at runtime but not in public types + // @ts-expect-error - internals.positionAbsolute exists at runtime but not in public types const intersectionNodePosition = intersectionNode.internals?.positionAbsolute ?? intersectionNode.position; - // @ts-ignore - internals.positionAbsolute exists at runtime but not in public types + // @ts-expect-error - internals.positionAbsolute exists at runtime but not in public types const targetPosition = targetNode.internals?.positionAbsolute ?? targetNode.position; // Use measured dimensions from React Flow (stored in node.measured) diff --git a/src/utils/handleMigration.ts b/src/utils/handleMigration.ts index a693865..f74fd33 100644 --- a/src/utils/handleMigration.ts +++ b/src/utils/handleMigration.ts @@ -18,12 +18,13 @@ const OLD_HANDLE_POSITIONS = ['top', 'right', 'bottom', 'left'] as const; export function migrateRelationHandles(relation: SerializedRelation): SerializedRelation { // Check if either handle uses old format const hasOldSourceHandle = - relation.sourceHandle != null && OLD_HANDLE_POSITIONS.includes(relation.sourceHandle as any); + relation.sourceHandle != null && OLD_HANDLE_POSITIONS.includes(relation.sourceHandle as typeof OLD_HANDLE_POSITIONS[number]); const hasOldTargetHandle = - relation.targetHandle != null && OLD_HANDLE_POSITIONS.includes(relation.targetHandle as any); + relation.targetHandle != null && OLD_HANDLE_POSITIONS.includes(relation.targetHandle as typeof OLD_HANDLE_POSITIONS[number]); // If old format detected, remove handle fields entirely for floating edge pattern if (hasOldSourceHandle || hasOldTargetHandle) { + // eslint-disable-next-line @typescript-eslint/no-unused-vars const { sourceHandle, targetHandle, ...relationWithoutHandles } = relation; return relationWithoutHandles; }