Type src/ against API and database shapes, fixing implicit anys #3

Merged
ngu-git-admin merged 1 commit from types/implicit-any into main 2026-09-25 10:25:05 +01:00

Fixes every implicit-any error in src/: pnpm exec tsc --noEmit --noImplicitAny now reports none (the repo config has noImplicitAny: false, so plain tsc --noEmit doesn't show them). pnpm build passes.

How

  • .d.ts declarations beside the untyped JS modules imported from TS: api.js, navConfig.js, adminSchema.js, adminNav.js, src/data/*.js. Import paths are unchanged.
  • Shapes come from the server: route queries in content.js, panel.js, admin.js, admin-entities.js, and the table definitions/CHECKs in the migrations.
  • get/post/patch/del return unknown unless the caller names the response type.
  • New list types in useContent.ts (OrganizationListItem, EventListItem, RegionArea).
  • defineSection() in sections.tsx checks each manifest entry's props against its own Component; Community and Retreats use it.
  • No any added.

Behaviour changes

  • Organization pages: website and email buttons rendered with no link and no text. splitLinks sends both as bare strings, but useContent.ts typed them (and instagram) as Link objects. Types corrected; website is now a "Website" button and email a mailto: link showing the address.
  • Community map: a region with no colour now falls back to FALLBACK_COLOR instead of painting its tiles black.

The seven remaining non-implicit-any errors are fixed in #4.

Not checked in a browser; there is no test suite.

🤖 Generated with Claude Code

Fixes every implicit-any error in `src/`: `pnpm exec tsc --noEmit --noImplicitAny` now reports none (the repo config has `noImplicitAny: false`, so plain `tsc --noEmit` doesn't show them). `pnpm build` passes. ## How - `.d.ts` declarations beside the untyped JS modules imported from TS: `api.js`, `navConfig.js`, `adminSchema.js`, `adminNav.js`, `src/data/*.js`. Import paths are unchanged. - Shapes come from the server: route queries in `content.js`, `panel.js`, `admin.js`, `admin-entities.js`, and the table definitions/CHECKs in the migrations. - `get`/`post`/`patch`/`del` return `unknown` unless the caller names the response type. - New list types in `useContent.ts` (`OrganizationListItem`, `EventListItem`, `RegionArea`). - `defineSection()` in `sections.tsx` checks each manifest entry's `props` against its own `Component`; Community and Retreats use it. - No `any` added. ## Behaviour changes - **Organization pages:** website and email buttons rendered with no link and no text. `splitLinks` sends both as bare strings, but `useContent.ts` typed them (and `instagram`) as `Link` objects. Types corrected; website is now a "Website" button and email a `mailto:` link showing the address. - **Community map:** a region with no colour now falls back to `FALLBACK_COLOR` instead of painting its tiles black. The seven remaining non-implicit-any errors are fixed in #4. Not checked in a browser; there is no test suite. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
ngu-git-admin added 1 commit 2026-09-25 10:14:02 +01:00
Adds .d.ts declarations beside the untyped JS modules imported from
TS (api.js, navConfig.js, adminSchema.js, adminNav.js, src/data/*),
with shapes taken from the server routes and migrations. get/post/
patch/del now return unknown unless the caller names the response.

Fixes found along the way:
- website/email/instagram are bare strings from splitLinks, not Link
  objects; OrganizationDetail's website and email pills rendered with
  no href or label and now link correctly.
- The chapter map falls back to FALLBACK_COLOR for a region with no
  colour instead of painting its tiles black.

Adds defineSection() so each page manifest entry's props are checked
against its own Component.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ngu-git-admin merged commit 9b91a9aa78 into main 2026-09-25 10:25:05 +01:00
ngu-git-admin deleted branch types/implicit-any 2026-09-25 10:25:05 +01:00
ngu-git-admin changed title from Type src/ against API and database shapes, fixing implicit anys to Type src/ against API and database shapes; clear all tsc errors 2026-09-25 10:27:48 +01:00
ngu-git-admin changed title from Type src/ against API and database shapes; clear all tsc errors to Type src/ against API and database shapes, fixing implicit anys 2026-09-25 10:33:49 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: ngu-git-admin/NGU-Web#3
No description provided.