Skip to content

Part 2: Fix Typescript errors (issue #508)#517

Open
agarg09 wants to merge 9 commits into
mainfrom
fix-Typescript-errors-part2
Open

Part 2: Fix Typescript errors (issue #508)#517
agarg09 wants to merge 9 commits into
mainfrom
fix-Typescript-errors-part2

Conversation

@agarg09

@agarg09 agarg09 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Finished up all the Typescript errors (from issue #508), currently no errors should be present when running npx tsc. Specifically (wordings taken exactly from issue):

  • src/components/UserProfile.tsx (3 errors: lines 66, 67, 156) — Lines 66/67: userAccount.username is string | undefined but used as string; stats object from API has optional fields but state is typed with required fields — the state initializer and API response type diverged. Line 156: userAccount.username possibly undefined.
  • src/components/PublicProfile.tsx (1 error: line 44) — Same stats optional-vs-required mismatch as UserProfile.tsx — fixed both together.
  • src/components/AboutPage.tsx (1 error: line 22) — string | Promise passed where string | Node is expected — an async function result (marked.parse()) used synchronously in a DOM context; fixed by awaiting the result.
  • src/components/RavelrySettings.tsx (3 errors: lines 540, 592, 596) — Line 540: No overload matches call — investigated and resolved with a fallback for missing timestamps. Lines 592/596: Property 'data' does not exist on type 'SaveLog' — SaveLog type had diverged from what the component expected; added the missing data field to the type.
  • src/tests/accessibility/ProductSubmission.a11y.test.tsx:26,27 — null not assignable to Product | undefined; changed null to undefined.
  • src/tests/accessibility/ProfileEdit.a11y.test.tsx:218 — No overload matches call; investigated the component's props and resolved with a non-null assertion on a guaranteed test fixture value.
  • src/components/ui/chart.tsx (5 errors: lines 107, 112, 258, 264, 276) — Recharts type definitions didn't match the installed version (payload, label, length, map properties missing from inferred types). Fixed by updating the component's type imports/annotations to match Recharts v3's actual exported types (TooltipContentProps, TooltipPayloadEntry) rather than the outdated v2-style types the component was written against.
  • src/components/ui/resizable.tsx (5 errors: lines 10, 12, 33, 37, 50) — Not in the original list; surfaced during cleanup. react-resizable-panels didn't export PanelGroup/PanelResizeHandle the way the code expected due to a library version mismatch. Fixed by updating references to the library's current export names (Group, Separator) at the installed version.

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation update
  • Test update
  • CI/workflow update

Validation

  • Tests added or updated where relevant
  • Local tests run for changed behavior
  • Lint passes

Notes for Reviewers

The most complicated changes were made in chart.tsx and resizable.tsx, where I looked at what the installed library actually exports and updated the code to use the correct names. Again, all tests pass when running npm test but I do want to confirm this looks correct.

@agarg09 agarg09 added the run-full-backend Trigger the required check to run the full backend. label Jul 24, 2026
@agarg09
agarg09 requested a review from jmankoff July 24, 2026 03:00
@agarg09 agarg09 added run-full-backend Trigger the required check to run the full backend. and removed run-full-backend Trigger the required check to run the full backend. labels Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-full-backend Trigger the required check to run the full backend.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant