fix: resolve all TypeScript LSP errors in CLI package #37

Merged
xiaoju merged 1 commits from fix/36-cli-lsp-errors into main 2026-06-02 02:59:18 +00:00
Owner

What

Eliminate all TypeScript errors in packages/cli for clean editor diagnostics.

Changes

packages/cli/tsconfig.json

  • Disable composite, declaration, declarationMap (inherited from root)
  • Add noEmit: true — CLI runs via bun, never compiled by tsc
  • Remove rootDir/outDir — eliminates all TS6059/TS6307 errors

packages/cli/src/index.ts

  • Use conditional spread (...(x !== undefined && { x })) for render options and tag params — satisfies exactOptionalPropertyTypes
  • Fix schemaHashschemaInput in template delete catch block (TS2304: variable out of scope)

Result

npx tsc --noEmit -p packages/cli/tsconfig.json0 errors

Ref

Fixes #36

## What Eliminate all TypeScript errors in `packages/cli` for clean editor diagnostics. ## Changes ### `packages/cli/tsconfig.json` - Disable `composite`, `declaration`, `declarationMap` (inherited from root) - Add `noEmit: true` — CLI runs via bun, never compiled by tsc - Remove `rootDir`/`outDir` — eliminates all TS6059/TS6307 errors ### `packages/cli/src/index.ts` - Use conditional spread (`...(x !== undefined && { x })`) for render options and tag params — satisfies `exactOptionalPropertyTypes` - Fix `schemaHash` → `schemaInput` in template delete catch block (TS2304: variable out of scope) ## Result `npx tsc --noEmit -p packages/cli/tsconfig.json` → **0 errors** ✅ ## Ref Fixes #36
xiaoju added 1 commit 2026-06-02 02:58:50 +00:00
1. CLI tsconfig: disable composite/declaration/declarationMap, enable
   noEmit — CLI runs via bun, never compiled by tsc. Eliminates all
   TS6059/TS6307 rootDir errors.

2. Use conditional spread to filter undefined values before passing to
   renderAsync/renderDirect/tag — satisfies exactOptionalPropertyTypes.

3. Fix TS2304: schemaHash not in scope in template delete catch block,
   use schemaInput instead.

Fixes #36
xiaoju force-pushed fix/36-cli-lsp-errors from 345455275f to 8176a228b2 2026-06-02 02:58:50 +00:00 Compare
xiaoju merged commit 02a364eb0b into main 2026-06-02 02:59:18 +00:00
Owner

代码 review 没问题 但有 merge conflict,小橘 rebase 一下 main 解掉冲突再合~

代码 review 没问题 ✅ 但有 merge conflict,小橘 rebase 一下 main 解掉冲突再合~
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shazhou/ocas#37