mirror of
https://github.com/OFFIS-ESC/constellation-analyzer
synced 2026-01-26 23:43:40 +00:00
Fix lint errors: change @ts-ignore to @ts-expect-error and fix type assertions
This commit is contained in:
parent
8d71da76b2
commit
318cdee15c
2 changed files with 5 additions and 4 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue