From a7fbc1ccc8b83d586bc7118a0dcfbbd51a29889f Mon Sep 17 00:00:00 2001 From: Jason Woltje Date: Thu, 26 Feb 2026 07:45:36 -0600 Subject: [PATCH] fix(api): fix lint errors in lazy node-pty import types Use proper import type instead of inline import() type annotations that violate @typescript-eslint/consistent-type-imports rule. Co-Authored-By: Claude Opus 4.6 --- apps/api/src/terminal/terminal.service.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/api/src/terminal/terminal.service.ts b/apps/api/src/terminal/terminal.service.ts index fbd28c9..820c0d3 100644 --- a/apps/api/src/terminal/terminal.service.ts +++ b/apps/api/src/terminal/terminal.service.ts @@ -14,13 +14,16 @@ */ import { Injectable, Logger, OnModuleInit } from "@nestjs/common"; +import type { IPty } from "node-pty"; import type { Socket } from "socket.io"; import { randomUUID } from "node:crypto"; // Lazy-loaded in onModuleInit via dynamic import() to prevent crash // if the native binary is missing. node-pty requires a compiled .node // binary which may not be available in all Docker environments. -type NodePtyModule = typeof import("node-pty"); +interface NodePtyModule { + spawn: (file: string, args: string[], options: Record) => IPty; +} let pty: NodePtyModule | null = null; /** Maximum concurrent PTY sessions per workspace */ @@ -36,7 +39,7 @@ const DEFAULT_ROWS = 24; export interface TerminalSession { sessionId: string; workspaceId: string; - pty: import("node-pty").IPty; + pty: IPty; name?: string; createdAt: Date; }