Bladeren bron

fix: resolve pre-existing check:ci failures (tui.ts + format)

Fixes #1065.

- src/tui.ts: replace void with undefined in Promise union types
  (noConfusingVoidType); no caller changes needed (early return already
  yields undefined, tests assert toBeUndefined())
- Format: src/tui.ts, src/tui.test.ts, and three task-session-manager
  files (idle-reconciliation.test.ts, runtime-status-reconciliation.ts,
  runtime-status-reconciliation.test.ts)
- biome.json: migrate deprecated 'recommended' to 'preset: recommended'
  via biome migrate (no behavioral change)

All gates pass: check:ci (0 errors/0 warnings), typecheck, bun test
(2169 pass, 0 fail).
Michael Henke 3 weken geleden
bovenliggende
commit
742ab01869

+ 1 - 1
biome.json

@@ -11,7 +11,7 @@
   "linter": {
     "enabled": true,
     "rules": {
-      "recommended": true,
+      "preset": "recommended",
       "suspicious": {
         "noExplicitAny": "warn"
       }

+ 7 - 2
src/hooks/task-session-manager/idle-reconciliation.test.ts

@@ -71,8 +71,13 @@ describe('idle reconciliation stop confirmation', () => {
   });
 
   test('repeated idle beyond confirmation grace becomes stopped exactly once', async () => {
-    const { board, reconciler, terminalListener, contextFilesForPrompt, prune } =
-      createHarness();
+    const {
+      board,
+      reconciler,
+      terminalListener,
+      contextFilesForPrompt,
+      prune,
+    } = createHarness();
     const generation = board.get('child-1')?.generation ?? 1;
 
     await observeIdle(reconciler, 10, generation);

+ 6 - 5
src/hooks/task-session-manager/runtime-status-reconciliation.test.ts

@@ -287,11 +287,12 @@ describe('runtime status reconciliation', () => {
   });
 
   test('repeated idle beyond confirmation grace becomes stopped exactly once', async () => {
-    const { board, reconciler, contextFilesForPrompt, prune } = createReconciler(
-      async () => ({ data: { 'child-1': { type: 'idle' } } }),
-      undefined,
-      0,
-    );
+    const { board, reconciler, contextFilesForPrompt, prune } =
+      createReconciler(
+        async () => ({ data: { 'child-1': { type: 'idle' } } }),
+        undefined,
+        0,
+      );
     const listener = mock(() => {});
     board.addTerminalStateListener(listener);
 

+ 4 - 1
src/hooks/task-session-manager/runtime-status-reconciliation.ts

@@ -97,7 +97,10 @@ export function createRuntimeStatusReconciler(options: {
         );
         continue;
       }
-      if (status === undefined && snapshot.malformedSessionIDs.has(job.taskID)) {
+      if (
+        status === undefined &&
+        snapshot.malformedSessionIDs.has(job.taskID)
+      ) {
         options.backgroundJobBoard.markStatusUncertain(
           job.taskID,
           'Runtime status response did not contain a recognized session state.',

+ 5 - 4
src/tui.test.ts

@@ -392,10 +392,11 @@ describe('dual-contract plugin module', () => {
           };
         },
         router: {
-          current: () => ({ type: 'home' }) as {
-            type?: string;
-            sessionID?: string;
-          },
+          current: () =>
+            ({ type: 'home' }) as {
+              type?: string;
+              sessionID?: string;
+            },
         },
       },
     };

+ 3 - 4
src/tui.ts

@@ -451,7 +451,7 @@ function v2ThemeView(theme: V2TuiThemeTokens): {
  * V2 entry point: sidebar slot + refresh loop; returns cleanup.
  * `/preset` stays v1-only (`api.command` is absent on v2).
  */
-async function setup(ctx: V2TuiContext): Promise<void | (() => void)> {
+async function setup(ctx: V2TuiContext): Promise<undefined | (() => void)> {
   if (isPluginDisabledByEnv()) return;
 
   const version = (await readPackageVersion()) ?? 'dev';
@@ -473,8 +473,7 @@ async function setup(ctx: V2TuiContext): Promise<void | (() => void)> {
       if (disposed) return;
       if (currentDirectory !== configDirectory) {
         configDirectory = currentDirectory;
-        ({ configInvalid, compactSidebar } =
-          readConfigState(configDirectory));
+        ({ configInvalid, compactSidebar } = readConfigState(configDirectory));
       }
       ctx.renderer.requestRender();
     } catch {
@@ -535,7 +534,7 @@ function buildPresetCommand(
 interface TuiDualContractModule {
   id: string;
   tui: TuiPlugin;
-  setup: (ctx: V2TuiContext) => Promise<void | (() => void)>;
+  setup: (ctx: V2TuiContext) => Promise<undefined | (() => void)>;
 }
 
 const plugin: TuiDualContractModule = {