Skip to content

fix: make tsc --noEmit pass cleanly#3

Closed
ruanbarroso wants to merge 2 commits into
mainfrom
chore/remove-orphaned-keysbrowser-backup
Closed

fix: make tsc --noEmit pass cleanly#3
ruanbarroso wants to merge 2 commits into
mainfrom
chore/remove-orphaned-keysbrowser-backup

Conversation

@ruanbarroso

Copy link
Copy Markdown
Owner

Problem

npm run type-check (tsc --noEmit) was failing even though next build succeeds. The build masks type errors because next.config sets typescript.ignoreBuildErrors: true, so tsc is the only thing that actually type-checks the project — and it was reporting 39 errors.

The originally-reported errors came from src/components/KeysBrowser.backup.tsx (malformed JSX), an orphaned file that isn't imported anywhere. But removing it revealed the rest of the project never type-checked cleanly either.

Changes

Orphaned stale files removed (unreferenced — confirmed via grep, outside the build dependency graph):

  • src/components/KeysBrowser.backup.tsx — malformed JSX (the 4 originally-reported errors)
  • src/components/Dashboard.old.tsx — referenced RedisStats fields that no longer exist

src/types/redis.ts:

  • Added 'none' to RedisDataType — Redis TYPE returns none for missing keys, and the code already shoehorned it in via casts
  • Added instantaneousInputKbps / instantaneousOutputKbps (real Redis INFO fields, parsed in the metrics route)
  • Allowed clientRttP50 / clientRttP95 to be number | null to match their producers and consumers

API routes:

  • command: destructure command name so redis.call() gets a tuple, not a spread
  • config / slowlog: type the unknown results of ioredis config() / slowlog()
  • monitor: annotate the monitor() callback params (no-implicit-any)
  • keys: explicit array type to break circular type inference
  • metrics: coalesce nullable connectionId to undefined

Components:

  • TreeView: fix @/store/store@/store import path
  • KeysBrowser: pass undefined for a null selectedKey; drop an impossible phase === 'cancelled' check (that phase never exists)
  • Monitor: type the fractionalSecondDigits option (absent from the ES2017 lib types); drop invalid Chip size="large"
  • KeysBrowser / TreeView: add none to the getTypeColor lookup maps

src/services/metrics.ts: guard possibly-undefined CPU stat fields.

Verification

npm run type-check now exits 0 with no errors. Changes are type-level or behavior-preserving (the dropped Chip size="large" was invalid and visuals come from sx; the dropped cancelled check was always-true dead code).

🤖 Generated with Claude Code

ruanbarroso and others added 2 commits June 1, 2026 10:52
The `npm run type-check` script (tsc --noEmit) was failing while
`next build` succeeded, because next.config sets
typescript.ignoreBuildErrors: true and never type-checks.

- Remove orphaned, unreferenced stale files that were never imported
  but broke tsc: KeysBrowser.backup.tsx (malformed JSX) and
  Dashboard.old.tsx (references to removed RedisStats fields).
- types/redis.ts: add 'none' to RedisDataType (Redis TYPE returns it
  for missing keys); add instantaneousInputKbps/OutputKbps; allow
  clientRttP50/P95 to be null to match producers/consumers.
- API routes: type ioredis call/config/slowlog results, annotate
  monitor callback params, break circular array inference in keys
  route, coalesce nullable connectionId.
- Components: fix @/store import path in TreeView, pass undefined for
  null selectedKey, drop impossible 'cancelled' phase check, type the
  fractionalSecondDigits option (absent from ES2017 lib), drop invalid
  Chip size="large".
- services/metrics.ts: guard possibly-undefined CPU stats.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Adding 'none' to RedisDataType requires the getTypeColor lookup maps
in KeysBrowser and TreeView to cover it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ruanbarroso ruanbarroso closed this Jun 1, 2026
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