Tags: zaherg/bab
Tags
fix(lint): narrow plugin adapter listModels result to string[] The biome --unsafe rewrite in a1f0d2f changed `plugin.adapter!.listModels!()` to `plugin.adapter?.listModels?.()`, widening the try-branch return type from `string[]` to `string[] | undefined`. The Promise.all element type then became `{ id: string; models: string[] | undefined }` (merge with the catch branch's `[] as string[]`), which broke lines 39-40 in the for-loop (`models.length` and `pluginModels[id] = models`). CI `bun test` is green; `tsc --noEmit` is what failed. Fix: `?? []` keeps the optional chaining biome wanted, narrows to `string[]` without the type lie, and matches the filter's narrowing on line 27. Co-authored-by: OpenCode <opencode@openai.com>
PreviousNext