Skip to content

chore: make tsc --noEmit (nearly) clean over the test suite - #728

Open
jaylfc wants to merge 2 commits into
tobi:mainfrom
jaylfc:chore/tsc-clean
Open

jaylfc wants to merge 2 commits into
tobi:mainfrom
jaylfc:chore/tsc-clean

Conversation

@jaylfc

@jaylfc jaylfc commented Jun 12, 2026

Copy link
Copy Markdown

What

npx tsc --noEmit on main currently reports 51 errors, almost all in test files. This brings it to 3 with zero behavior change: type annotations, import-specifier extensions, and narrowing only. No tsconfig, package.json, or runtime logic touched.

  • 21 import specifiers: added the explicit .js extensions ESM resolution wants (14 missing, 7 written as .ts), matching the convention the rest of the codebase already uses.
  • 20 implicit-any parameters: 19 cleared as a cascade of the import fixes (the broken specifiers were erasing the imported types), 1 explicit RerankDocumentResult annotation.
  • 4 unknown narrows on res.json() in cli/mcp tests, 2 typed locals in src/bench-rerank.ts (annotation only), 1 non-null assert after a length assertion.

The 3 left

  • migrate-schema.ts and src/test-preload.ts: bun:sqlite / bun:test have no installed types. Adding @types/bun to devDependencies would clear both; left out since it touches package.json, happy to add it here if you want.
  • src/bench-rerank.ts: passing flashAttention into createRankingContext is runtime-intentional (the catch block probes for support and recovers), and the installed node-llama-cpp typings do not declare it. Typing around it would change what the bench exercises, so it stays.

Why

Every open PR rebases onto this baseline; with the noise gone, a new red tsc line means the PR actually introduced it (#663's branch, for example, currently carries 6 new ones that are invisible against the 51).

Tests

Fast subset (no local models): 200/200 pass, twice (independent reruns). Baseline comparison on main showed the same single pre-existing model-dependent timeout in mcp.test.ts before and after.

jaylfc added 2 commits June 12, 2026 14:01
Fixes TS2835 (missing .js extension) and TS5097 (.ts extension) errors
in test files and src/test-preload.ts under --moduleResolution node16.
Fixes TS7034/7005 (contexts array in bench-rerank.ts), TS18046 (body
casts in cli.test.ts and mcp.test.ts), TS7006 (item in llm.test.ts),
and TS2532 (non-null assertion in multi-collection-filter.test.ts).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant