Skip to content

Replace tsc with oxlint --type-check for unified linting & type-checking - #17

Merged
CS-5 merged 4 commits into
v2from
claude/catalyst-v2-upgrade-review-ut5913
Jul 26, 2026
Merged

Replace tsc with oxlint --type-check for unified linting & type-checking#17
CS-5 merged 4 commits into
v2from
claude/catalyst-v2-upgrade-review-ut5913

Conversation

@CS-5

@CS-5 CS-5 commented Jul 26, 2026

Copy link
Copy Markdown
Member

Consolidates type-checking and linting into a single oxlint --type-check command (via the new oxlint-tsgolint plugin), replacing the parallel oxlint + tsc workflow. This simplifies the toolchain, reduces CI/local feedback latency, and unifies diagnostics under one tool.

Key changes

  • Post-edit hook (.claude/hooks/post-edit.sh): Replaced parallel oxlint + tsc with single oxlint --type-check --deny-warnings call covering both app and scripts projects
  • npm scripts (package.json): typecheck now runs oxlint --deny-warnings --type-check instead of dual tsc invocations
  • Dependencies: Added oxlint-tsgolint@^7.0.2001 (type-aware oxlint plugin); upgraded oxlint to ^1.74.0; removed direct tsc dependency from typecheck flow
  • oxlint config (.oxlintrc.json): Enabled typeAware: true option to activate type-aware rules
  • mise tasks (mise.toml): Updated typecheck task description and added generate:types dependency (ensures worker-configuration.d.ts exists before type-checking)
  • Documentation (docs/DEPLOY.md, DESIGN.md): Updated references to reflect single oxlint --type-check command instead of separate lint/tsc steps
  • pnpm workspace (pnpm-workspace.yaml): Approved oxlint-tsgolint@7.0.2001 past the 7-day release gate (paired with TypeScript 7.0.2)

Implementation details

  • The hook now creates a single temp file for output instead of two, simplifying error reporting
  • pn alias fallback added for remote/CI containers that have pnpm but not the pn shorthand
  • Type-checking scope remains whole-repo (both tsconfig projects) but now runs in a single pass
  • Error output capped at 60 lines (vs. 40 for tsc) to accommodate richer diagnostics

https://claude.ai/code/session_01JdivZT1wymu1zuyiVJCXK3

claude added 4 commits July 26, 2026 14:42
- pnpm up --latest within the 7-day age gate (Babel 8, vite 8.1.5,
  wrangler 4.112, Sentry 10.66, hono 4.12.31, oxlint 1.74, oxfmt 0.59,
  @hono/zod-validator 0.9, and friends); build verified.
- Drop the expired typescript age-gate exclusion; whitelist
  oxlint-tsgolint (+ platform binaries) per explicit approval.
- Enable options.typeAware in .oxlintrc.json — stable as of 2026-07-22,
  adds 59 typescript-eslint type-aware rules at ~3.5s for the repo.
  no-unsafe-type-assertion is off (14 hits, all stylistic).
- Fix everything the new rules caught: 4 floating promises (unhandled
  router.navigate/invalidateQueries), inconsistent returns in effects
  and auth middleware, unnecessary assertions/conversions.
- post-edit hook: fall back to pnpm when the `pn` alias is absent
  (remote containers); fix useMemo(fn, []) form for react-compiler.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JdivZT1wymu1zuyiVJCXK3
Server (security/bugs review):
- MAX_BATCH_IDS 100→90 (+ client DataLoader maxBatchSize) so full
  batches stay under D1's 100-bound-parameter cap; limit params now
  require integers (2.5 previously 500'd at SQLite).
- syncRoles no longer bumps last_synced_at, which was permanently
  starving the 30-day profile-staleness refresh for logged-in users.
- Sentry beforeSend scrubs lowercase cookie/authorization (the
  capitalized deletes were a no-op against SDK-normalized headers).
- Aggregate integrity check now also verifies user_emoji_counts.
- buzzkill documented as a soft limit under concurrent deliveries.

Client (bugs review):
- Season selector off-by-one: first season derived with the July
  boundary rule (new shared seasonOf helper).
- Season/interval filters lifted to _authed so visiting parrots or
  members no longer resets them.
- Login redirect hardened to same-origin paths and preserved for
  already-authed visitors and mid-session expiry.
- Admin settings form re-keys on background refetch; role-override
  mutation also invalidates ["me"]; CircuitField redraws after resize
  under reduced motion; vaporwave textures disposed on unmount; mobile
  interval select only shows on the trends tab where it has effect.

Theme (per DESIGN.md, audit-driven):
- Tokens: type scale (--text-label/small/h3/h2/display), density
  (--pad/--row-gap), --press-offset (loud-only button press),
  brand-press + font-display bridged into @theme, `label` and
  `scrollbar-none` utilities, `loud:` custom variant.
- Fixed light-theme bugs (chart stroke-white, text-main heading,
  leaderboard hover) and mood leaks (fixed border-2/rounded-lg/
  shadow-xl now token-driven; calm buttons no longer jump).
- Avatar fallback matches spec (brand→warn gradient, initials).
- DESIGN.md: token→utility naming table, documented new tokens.

DX (organization/comments review):
- day/week/month union consolidated as PERIODS in @shared (zod enum,
  Period, ChartInterval all derive); one CHART_PALETTE constant
  replaces two drifted copies; text-danger standardized.
- scripts/sync-emojis.ts imports slackApi instead of duplicating the
  retry helper; dead exports removed (toSqliteTimestamp,
  canEditSettings, canViewReactions, unused validation/reconcile
  exports, unused auth-client re-exports).
- Avatar/GlowingText moved to components/ui per the three-tier rule.
- Stale comments fixed (hourly→daily cron, dead backfill references,
  filled-in TODO); doc rot fixed (DEPLOY.md backfill section,
  CLAUDE.md→PLAN.md pointer, plan 03 path).
- mise typecheck depends on generate:types (fresh-clone DX).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JdivZT1wymu1zuyiVJCXK3
One command now covers lint, type-aware rules, and full TS diagnostics
for both tsconfig projects (verified: injected type errors in src/ and
scripts/ are both caught). verify drops its separate lint step since
typecheck subsumes it; the post-edit hook likewise collapses its
parallel oxlint+tsc pair into a single oxlint --type-check run.
typescript stays as a devDependency for the editor/tsserver and
codegen tooling.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JdivZT1wymu1zuyiVJCXK3
Re-enabled as a warning (--deny-warnings makes it enforce) instead of
the blanket off: the rule catches casts that can mask real type errors.
Fixes at each site rather than suppressions:

- New isOneOf type guard narrows Select/Tabs string values properly
  (chart interval, chart tab, admin role override) — bad values are now
  ignored instead of blindly cast.
- DevLoginPanel narrows the error payload from unknown instead of
  asserting a shape.
- auth.ts reads the Slack team_id claim through Record<string, unknown>
  instead of asserting the whole SlackProfile.
- slack/api.ts goes through unknown so both tsconfig programs agree.

Three justified inline disables remain, each with a reason: the Slack
response generic (ok/error runtime-checked), hono's typed ok-branch
body, and the env-less CLI schema-generation placeholder binding. The
shadcn primitives dir keeps the rule off alongside its existing
relaxations.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JdivZT1wymu1zuyiVJCXK3
@CS-5
CS-5 merged commit a899b30 into v2 Jul 26, 2026
@CS-5
CS-5 deleted the claude/catalyst-v2-upgrade-review-ut5913 branch July 26, 2026 17:53
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.

2 participants