CLI: fix TypeScript LSP errors in packages/cli #36
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
packages/cli/src/index.tshas multiple pre-existing TypeScript errors visible in LSP. The CLI works fine (runs viabundirectly, nottsc --build), but these errors pollute editor diagnostics.Three categories
1. TS6059/TS6307 — rootDir conflict (bulk of errors)
CLI tsconfig sets
rootDir: src, butworkspace:*resolution points bun atpackages/core/src/andpackages/fs/src/source files directly. tsc sees them as outside rootDir.Fix options:
referencesto core/fs in CLI tsconfig (proper composite project setup)2. TS2379 — exactOptionalPropertyTypes mismatch
resolution: number | undefinedis not assignable toresolution?: numberunderexactOptionalPropertyTypes: true. Affects:renderAsync()calls (~3 sites)renderDirect()calls (~1 site)varStore.tag()call (~1 site)Fix: Filter out undefined values before passing, or use spread with conditional properties.
3. TS2304 —
Cannot find name schemaHash(line ~1043)A reference to a variable that doesn't exist in scope.
Fix: Likely a leftover from a refactor — find the intended variable and fix the reference.
Notes