Skip to content

feat: convert components and pages to TypeScript#59

Merged
mjdavidson merged 1 commit intomasterfrom
mattd/explore-ts-client
May 7, 2026
Merged

feat: convert components and pages to TypeScript#59
mjdavidson merged 1 commit intomasterfrom
mattd/explore-ts-client

Conversation

@mjdavidson
Copy link
Copy Markdown
Contributor

Stacked on #58. 12 client-side files migrated, completing the JS → TS transition.

Notable cleanups picked up by strict typing:

  • LoginWithSSO was passing <Alert succeeded={...} /> but Alert reads success — the alert always rendered as a failure regardless of outcome. Fixed.
  • pages/app/{login,sso}.tsx had e shadowing onSubmit's param in catch blocks. Replaced class methods with arrow-function properties + catch (err), dropping the inner .bind(this).
  • Settings now has a proper Intent union type instead of stringly-typed intent.
  • All class render methods carry override (required by noImplicitOverride).
  • globals.d.ts adds declare module '*.css' so the side-effect CSS import in _app typechecks.

Config files (next.config.js, instrumentation-client.js, tailwind.config.js, postcss.config.js) intentionally stay JS.

Lint warnings: 3 → 0.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
explore Ready Ready Preview, Comment May 7, 2026 10:03pm

Request Review

Base automatically changed from mattd/explore-ts-server to master May 7, 2026 21:59
12 files migrated client-side, completing the JS → TS transition:
- 6 components: Alert, Home, Layout, LoginWithEmail, LoginWithSSO, Settings
- pages/_app.tsx
- pages/index.tsx (marketing landing)
- pages/app/{index,login,settings,sso}.tsx

Notable cleanups picked up by strict typing:
- LoginWithSSO was using <Alert succeeded={...} /> but Alert reads
  `success` — the alert always rendered as a failure regardless of
  outcome. Fixed.
- pages/app/{login,sso}.tsx had `e` shadowing onSubmit's parameter
  in catch blocks. Replaced class methods with arrow-function
  properties + `catch (err)`, dropping the inner .bind(this).
- Settings now has a proper Intent union type instead of a stringly-
  typed `intent` parameter.
- All class component renders carry the `override` modifier required
  by tsconfig's `noImplicitOverride`.

globals.d.ts adds `declare module '*.css'` for side-effect CSS imports
(the previous tailwind.css import in _app was unrecognised by tsc).

The 4 config files (next.config.js, instrumentation-client.js,
tailwind.config.js, postcss.config.js) intentionally stay JS — no
benefit to converting them.

Verified: typecheck (strict, 0 errors), lint (0 warnings), format,
build all clean.
@mjdavidson mjdavidson force-pushed the mattd/explore-ts-client branch from 53d6af6 to 28e9e04 Compare May 7, 2026 22:02
@mjdavidson mjdavidson merged commit ce9942b into master May 7, 2026
9 checks passed
@mjdavidson mjdavidson deleted the mattd/explore-ts-client branch May 7, 2026 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant