Skip to content

test(frontend): enforce TypeScript check - #826

Merged
lilyshen0722 merged 1 commit into
mainfrom
fix/frontend-typecheck-gate
Aug 4, 2026
Merged

test(frontend): enforce TypeScript check#826
lilyshen0722 merged 1 commit into
mainfrom
fix/frontend-typecheck-gate

Conversation

@lilyshen0722

Copy link
Copy Markdown
Contributor

Summary

  • add the existing frontend typecheck script to the Test & Coverage workflow
  • clear the five current compiler errors before enabling the gate
  • align socket reaction payload typing with the decorated backend wire shape (users[{ id, username, displayName? }])

Verification

  • PATH=/opt/homebrew/opt/node@22/bin:$PATH npm --prefix frontend run typecheck
  • cd frontend && PATH=/opt/homebrew/opt/node@22/bin:$PATH npm test
  • focused message-bubble + reaction tests (5/5)
  • targeted ESLint: 0 errors (3 existing JSX-extension warnings)

Mutation proof

Removing the typed PR-summary boundary returns the original state-widening error: the frontend typecheck fails at the cache insertion/return boundary.

@lilyshen0722
lilyshen0722 merged commit b9f5e3e into main Aug 4, 2026
12 checks passed
@lilyshen0722
lilyshen0722 deleted the fix/frontend-typecheck-gate branch August 4, 2026 20:23
samxu01 pushed a commit that referenced this pull request Aug 4, 2026
packages/types defines `typecheck: tsc --noEmit` and nothing has ever
invoked it — the same defined-but-uninvoked shape #826 fixes for the
frontend. It is green today, which is the only moment a gate is free.

Costs no install: the package has zero dependencies and zero external
imports, so it typechecks with the compiler the backend step already
installed. Two lines and a comment.

packages/commonly-apps is deliberately left out. It has the identical
uninvoked `tsc:check` script, but it needs @types/node and this job never
npm ci's it, so gating it means adding an install step. Its real state is
unknown rather than assumed green — reporting it as green off a TS2688
"cannot find type definition file for 'node'" would be reporting an
environment gap as a result.

Mutation-checked: a deliberate `const x: number = "str"` in src/user.ts
fails the step with TS2322 (exit 2), and the step returns to exit 0 once
reverted, so the gate can actually go red.

Stacked on #826 (25e6de7) because it is the only other open PR touching
tests.yml; merging it first avoids a conflict in the same hunk.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
lilyshen0722 added a commit that referenced this pull request Aug 4, 2026
packages/types defines `typecheck: tsc --noEmit` and nothing has ever
invoked it — the same defined-but-uninvoked shape #826 fixes for the
frontend. It is green today, which is the only moment a gate is free.

Costs no install: the package has zero dependencies and zero external
imports, so it typechecks with the compiler the backend step already
installed. Two lines and a comment.

packages/commonly-apps is deliberately left out. It has the identical
uninvoked `tsc:check` script, but it needs @types/node and this job never
npm ci's it, so gating it means adding an install step. Its real state is
unknown rather than assumed green — reporting it as green off a TS2688
"cannot find type definition file for 'node'" would be reporting an
environment gap as a result.

Mutation-checked: a deliberate `const x: number = "str"` in src/user.ts
fails the step with TS2322 (exit 2), and the step returns to exit 0 once
reverted, so the gate can actually go red.

Stacked on #826 (25e6de7) because it is the only other open PR touching
tests.yml; merging it first avoids a conflict in the same hunk.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
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