You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Replace interface to type for every prop react #34
The issue has no body, so I scoped it from the title: every React prop declaration in the workspace should be a type alias. I inventoried all interface declarations in tracked source (libs/ has zero; node_modules excluded).
Current state
apps/web is already inconsistent with itself — the three inner form components introduced in #32 use type, while every outer component still uses interface:
// edit-line-item.tsx:25interfaceEditLineItemProps{…}// edit-line-item.tsx:63 — same file, different styletypeEditLineItemFormProps={…};
So this is a consistency cleanup that follows the direction the codebase already moved in.
Milestone 1 — convert the 11 prop interfaces
All 11 are plain, local (non-exported), and none use extends, so each is a two-line mechanical edit (interface X { → type X = {, closing } → };). No intersections needed, no call sites change.
Keep the existing doc comment on MoneyProps.suffix and the React.ReactNode / React.RefObject member types verbatim.
Explicitly out of scope
apps/web/src/app/router.tsx:7 — interface Register must stay an interface. It is a declare module '@tanstack/react-router' augmentation, and TypeScript declaration merging only works with interfaces. Converting it breaks typed routing.
apps/web/src/app/route-tree.gen.ts — generated by TanStack Router and already excluded from Biome via !**/*.gen.ts.
apps/api/src/env.d.ts (Env, also a global augmentation), apps/api/src/storage/object-storage.ts, apps/api/src/storage/gcs.ts — not React props.
Non-prop web types ReceiptTotals (features/session/utils/receipt-totals.ts:3) and CurrencyFormat (utils/money.ts:16) — not props. Worth folding in only if milestone 2 is adopted; otherwise leave them.
Milestone 2 (optional) — enforce it so it does not drift back
Biome 2.5.5 (the pinned version) ships style/useConsistentTypeDefinitions as a stable rule, so no nursery opt-in is needed. Adding it to the existing apps/web/** override in biome.json:
It applies to all type definitions in apps/web, not just props — so ReceiptTotals and CurrencyFormat must be converted too.
It flags interface Register in router.tsx, which cannot be converted. That needs a targeted suppression: // biome-ignore lint/style/useConsistentTypeDefinitions: module augmentation requires an interface
Scope the override to apps/web/** only — a root-level rule would fail nx lint api on ObjectStorage, GcsObjectStorageOptions, and Env.
If a one-line suppression in router.tsx is unwanted, skip milestone 2 and ship milestone 1 alone; the issue is labelled good first issue and the conversion stands on its own.
Verification
Only apps/web is touched, so the relevant gates are:
bun nx tsc:typecheck web
bun nx lint web
bun nx run web:format:check # not `nx format:check web` — that hits Nx's built-in and misreports
bun nx build web
Type-level no-op, so bun nx test web should pass unchanged. Note type aliases drop declaration merging and the implicit-index-signature behaviour interfaces have; neither is used by any of these 11, so there is no runtime or type-surface risk.
Delivery
One PR on pullfrog/34-props-type-aliases, one commit for milestone 1 and (if adopted) a second for milestone 2, so the enforcement change can be dropped independently in review.
Opened #35 on pullfrog/34-props-type-aliases, implementing both milestones as two separable commits.
Commit 1 converts the 11 component prop declarations from interface to type — all were plain, local, and extends-free, so each was a two-line mechanical edit with no call-site changes. This aligns the outer components with the three inner form components from #32, which already used type.
Commit 2 adds Biome's style/useConsistentTypeDefinitions (stable at the pinned 2.5.5) to the apps/web/** override so the convention cannot drift back. Two follow-ons were required and are included: ReceiptTotals and CurrencyFormat are converted since the rule covers all type definitions, and interface Register in app/router.tsx gets a targeted biome-ignore because it is a declare module augmentation and declaration merging only works with interfaces. I verified that suppression is load-bearing rather than dead — with it removed, biome lint errors and offers exactly the type Register = {…} fix that would break typed routing. The override is scoped to apps/web/**; a root-level rule would redden nx lint api.
Verified with nx sync:check plus run-many -t lint format:check, tsc:typecheck web, run-many -t test, and build web — all passing, with lint web showing the same 6 pre-existing warnings as main and zero errors.
Activity
pullfrog commentedon Aug 13, 2026
Plan: replace
interfacewithtypefor React propsThe issue has no body, so I scoped it from the title: every React prop declaration in the workspace should be a
typealias. I inventoried allinterfacedeclarations in tracked source (libs/has zero;node_modulesexcluded).Current state
apps/webis already inconsistent with itself — the three inner form components introduced in #32 usetype, while every outer component still usesinterface:So this is a consistency cleanup that follows the direction the codebase already moved in.
Milestone 1 — convert the 11 prop interfaces
All 11 are plain, local (non-exported), and none use
extends, so each is a two-line mechanical edit (interface X {→type X = {, closing}→};). No intersections needed, no call sites change.apps/web/src/components/ui/money.tsx:5MoneyPropsapps/web/src/components/ui/form/currency-input.tsx:5CurrencyInputPropsapps/web/src/features/session/components/session-draft.tsx:12ReviewLayoutPropsapps/web/src/features/session/components/confirm-session-button.tsx:8ConfirmSessionButtonPropsapps/web/src/features/session/components/receipt-capture.tsx:87CaptureViewPropsapps/web/src/features/session/components/edit-receipt-total.tsx:24EditReceiptTotalPropsapps/web/src/features/session/line-item/components/add-line-item.tsx:24AddLineItemPropsapps/web/src/features/session/line-item/components/delete-line-item.tsx:19DeleteLineItemPropsapps/web/src/features/session/line-item/components/edit-line-item.tsx:25EditLineItemPropsapps/web/src/features/session/line-item/components/line-item-list.tsx:5LineItemListPropsapps/web/src/features/session/line-item/components/line-item-row.tsx:7LineItemRowPropsKeep the existing doc comment on
MoneyProps.suffixand theReact.ReactNode/React.RefObjectmember types verbatim.Explicitly out of scope
apps/web/src/app/router.tsx:7—interface Registermust stay aninterface. It is adeclare module '@tanstack/react-router'augmentation, and TypeScript declaration merging only works with interfaces. Converting it breaks typed routing.apps/web/src/app/route-tree.gen.ts— generated by TanStack Router and already excluded from Biome via!**/*.gen.ts.apps/api/src/env.d.ts(Env, also a global augmentation),apps/api/src/storage/object-storage.ts,apps/api/src/storage/gcs.ts— not React props.ReceiptTotals(features/session/utils/receipt-totals.ts:3) andCurrencyFormat(utils/money.ts:16) — not props. Worth folding in only if milestone 2 is adopted; otherwise leave them.Milestone 2 (optional) — enforce it so it does not drift back
Biome 2.5.5 (the pinned version) ships
style/useConsistentTypeDefinitionsas a stable rule, so no nursery opt-in is needed. Adding it to the existingapps/web/**override inbiome.json:Two consequences to accept before taking this:
apps/web, not just props — soReceiptTotalsandCurrencyFormatmust be converted too.interface Registerinrouter.tsx, which cannot be converted. That needs a targeted suppression:// biome-ignore lint/style/useConsistentTypeDefinitions: module augmentation requires an interfaceScope the override to
apps/web/**only — a root-level rule would failnx lint apionObjectStorage,GcsObjectStorageOptions, andEnv.If a one-line suppression in
router.tsxis unwanted, skip milestone 2 and ship milestone 1 alone; the issue is labelled good first issue and the conversion stands on its own.Verification
Only
apps/webis touched, so the relevant gates are:Type-level no-op, so
bun nx test webshould pass unchanged. Notetypealiases drop declaration merging and the implicit-index-signature behaviour interfaces have; neither is used by any of these 11, so there is no runtime or type-surface risk.Delivery
One PR on
pullfrog/34-props-type-aliases, one commit for milestone 1 and (if adopted) a second for milestone 2, so the enforcement change can be dropped independently in review.Claude Opus| 𝕏pullfrog commentedon Aug 13, 2026
Opened #35 on
pullfrog/34-props-type-aliases, implementing both milestones as two separable commits.Commit 1 converts the 11 component prop declarations from
interfacetotype— all were plain, local, andextends-free, so each was a two-line mechanical edit with no call-site changes. This aligns the outer components with the three inner form components from #32, which already usedtype.Commit 2 adds Biome's
style/useConsistentTypeDefinitions(stable at the pinned 2.5.5) to theapps/web/**override so the convention cannot drift back. Two follow-ons were required and are included:ReceiptTotalsandCurrencyFormatare converted since the rule covers all type definitions, andinterface Registerinapp/router.tsxgets a targetedbiome-ignorebecause it is adeclare moduleaugmentation and declaration merging only works with interfaces. I verified that suppression is load-bearing rather than dead — with it removed,biome linterrors and offers exactly thetype Register = {…}fix that would break typed routing. The override is scoped toapps/web/**; a root-level rule would reddennx lint api.Verified with
nx sync:checkplusrun-many -t lint format:check,tsc:typecheck web,run-many -t test, andbuild web— all passing, withlint webshowing the same 6 pre-existing warnings asmainand zero errors.Claude Opus| 𝕏