fix: Resolve TypeScript type errors in codebase #49

Closed
opened 2026-01-22 06:33:34 +00:00 by jack · 0 comments
Owner

Problem

Running npm run typecheck reveals numerous TypeScript errors. The build works because Bun handles types at runtime, but strict type checking fails.

Error Categories

1. bun:sqlite module not found (~19 errors)

TypeScript doesn't recognize Bun-specific modules.

src/services/sqlite/Database.ts(1,26): error TS2307: Cannot find module 'bun:sqlite'

Solution: Add Bun type definitions or create type stubs.

2. Logger Component type too restrictive (~50+ errors)

Strings like "CURSOR", "CHROMA_SYNC", "QUEUE" are not in the Component type.

error TS2345: Argument of type '"CURSOR"' is not assignable to parameter of type 'Component'.

Solution: Extend the Component type union in src/utils/logger.ts.

3. React event target types (~30+ errors)

e.target.value and e.target.checked not recognized on event targets.

error TS2339: Property 'value' does not exist on type 'EventTarget & HTMLInputElement'.

Solution: Use proper event typing: ChangeEvent<HTMLInputElement> etc.

4. Miscellaneous type issues

  • Missing homedir import in CursorHooksInstaller.ts
  • HookResult missing context property
  • Exit codes enum incomplete
  • Unknown type handling

Impact

  • Build works (Bun handles types at runtime)
  • IDE type checking partially broken
  • CI type checking would fail

Acceptance Criteria

  • npm run typecheck passes with 0 errors
  • All Component strings added to type union
  • Bun type definitions installed or stubbed
  • React event handlers properly typed
## Problem Running `npm run typecheck` reveals numerous TypeScript errors. The build works because Bun handles types at runtime, but strict type checking fails. ## Error Categories ### 1. `bun:sqlite` module not found (~19 errors) TypeScript doesn't recognize Bun-specific modules. ``` src/services/sqlite/Database.ts(1,26): error TS2307: Cannot find module 'bun:sqlite' ``` **Solution:** Add Bun type definitions or create type stubs. ### 2. Logger Component type too restrictive (~50+ errors) Strings like `"CURSOR"`, `"CHROMA_SYNC"`, `"QUEUE"` are not in the `Component` type. ``` error TS2345: Argument of type '"CURSOR"' is not assignable to parameter of type 'Component'. ``` **Solution:** Extend the `Component` type union in `src/utils/logger.ts`. ### 3. React event target types (~30+ errors) `e.target.value` and `e.target.checked` not recognized on event targets. ``` error TS2339: Property 'value' does not exist on type 'EventTarget & HTMLInputElement'. ``` **Solution:** Use proper event typing: `ChangeEvent<HTMLInputElement>` etc. ### 4. Miscellaneous type issues - Missing `homedir` import in CursorHooksInstaller.ts - `HookResult` missing `context` property - Exit codes enum incomplete - Unknown type handling ## Impact - Build works (Bun handles types at runtime) - IDE type checking partially broken - CI type checking would fail ## Acceptance Criteria - [ ] `npm run typecheck` passes with 0 errors - [ ] All Component strings added to type union - [ ] Bun type definitions installed or stubbed - [ ] React event handlers properly typed
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
customable/claude-mem#49
No description provided.