Fix lint errors: change @ts-ignore to @ts-expect-error and fix type assertions

This commit is contained in:
Jan-Henrik Bruhn 2026-01-24 16:05:50 +01:00
parent 8d71da76b2
commit 318cdee15c
2 changed files with 5 additions and 4 deletions

View file

@ -191,9 +191,9 @@ function getNodeIntersection(
): { x: number; y: number; angle: number } { ): { x: number; y: number; angle: number } {
// Use positionAbsolute for correct positioning of nodes inside groups // Use positionAbsolute for correct positioning of nodes inside groups
// positionAbsolute accounts for parent group offset, while position is relative // 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; 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; const targetPosition = targetNode.internals?.positionAbsolute ?? targetNode.position;
// Use measured dimensions from React Flow (stored in node.measured) // Use measured dimensions from React Flow (stored in node.measured)

View file

@ -18,12 +18,13 @@ const OLD_HANDLE_POSITIONS = ['top', 'right', 'bottom', 'left'] as const;
export function migrateRelationHandles(relation: SerializedRelation): SerializedRelation { export function migrateRelationHandles(relation: SerializedRelation): SerializedRelation {
// Check if either handle uses old format // Check if either handle uses old format
const hasOldSourceHandle = 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 = 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 old format detected, remove handle fields entirely for floating edge pattern
if (hasOldSourceHandle || hasOldTargetHandle) { if (hasOldSourceHandle || hasOldTargetHandle) {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { sourceHandle, targetHandle, ...relationWithoutHandles } = relation; const { sourceHandle, targetHandle, ...relationWithoutHandles } = relation;
return relationWithoutHandles; return relationWithoutHandles;
} }