chore(types): enable exactOptionalPropertyTypes - #311
Conversation
Fixes for resulting type errors are in progress on this branch. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QvzpJZujRJYbrrUg17nT78
Widens prop/param types to accept undefined where "not yet loaded" and "absent" are equivalent, and switches mutation payload builders (useUpdateSet, useUpdateProfile, useCreateGroup, useGenerateInviteMutation, parseCsv) to spread optional fields conditionally instead of assigning undefined directly. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QvzpJZujRJYbrrUg17nT78
…StageSelector Omit the value prop conditionally instead of coercing undefined to "", so Radix ToggleGroup/Select behave the same as before the type fix. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QvzpJZujRJYbrrUg17nT78
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
There was a problem hiding this comment.
Pull request overview
Enables TypeScript’s exactOptionalPropertyTypes strictness flag for the app build and updates call sites/types to comply—primarily by (a) explicitly accepting undefined in prop/param types where callers pass T | undefined, and (b) omitting optional keys in mutation payloads/parsed objects instead of assigning undefined.
Changes:
- Enable
exactOptionalPropertyTypesintsconfig.app.json. - Fix resulting type errors across UI props, hook inputs, and data types by widening to
T | undefinedwhere needed. - Update several payload/object builders to conditionally spread optional fields so keys are absent rather than explicitly
undefined.
Reviewed changes
Copilot reviewed 56 out of 56 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tsconfig.app.json | Enables exactOptionalPropertyTypes for stricter optional-property semantics. |
| src/services/scheduleImport/parseCsv.ts | Omits optional CSV fields via conditional spreads instead of assigning undefined. |
| src/routes/festivals/$festivalSlug/editions/$editionSlug/schedule/list.tsx | Updates optional stageColor typing to accept explicit undefined. |
| src/pages/Settings/ActiveGroupSetting.tsx | Omits value prop when activeGroupId is undefined to satisfy exact-optional rules. |
| src/pages/ExploreSetPage/useExplorableSets.tsx | Widens editionId parameter type to `string |
| src/pages/ExploreSetPage/SetExploreCard/SoundCloudBadge.tsx | Widens optional callback type to accept explicit undefined. |
| src/pages/ExploreSetPage/SetExploreCard/SetCardHeader.tsx | Widens optional stageId prop type to accept explicit undefined. |
| src/pages/ExploreSetPage/SetExploreCard/SetAudioPlayer.tsx | Widens optional soundcloudUrl prop type to accept explicit undefined. |
| src/pages/EditionView/tabs/VoteTab/filters/FilterSortControls.tsx | Widens optional votePerspective prop type to accept explicit undefined. |
| src/pages/EditionView/tabs/ScheduleTab/list/TimeSlotGroup.tsx | Widens optional types (stageColor, timezone) to accept explicit undefined. |
| src/pages/EditionView/tabs/ScheduleTab/list/MobileSetCard.tsx | Widens optional stageColor/timezone types to accept explicit undefined. |
| src/pages/EditionView/tabs/ScheduleTab/list/ListDayGroup.tsx | Widens optional stageColor typing to accept explicit undefined. |
| src/pages/EditionView/tabs/ScheduleTab/horizontal/StageRow.tsx | Widens optional stage color type to accept explicit undefined. |
| src/pages/EditionView/tabs/ScheduleTab/horizontal/StageLabels.tsx | Widens optional stage color type to accept explicit undefined. |
| src/pages/EditionView/tabs/InfoTab/EditionTitle.tsx | Widens optional name type to accept explicit undefined. |
| src/pages/EditionView/EditionHero.tsx | Widens optional logoUrl type to accept explicit undefined. |
| src/pages/admin/festivals/StageSelector.tsx | Omits Select value prop when undefined to satisfy exact-optional rules. |
| src/pages/admin/festivals/info/FestivalFields/FestivalSocialField.tsx | Widens optional social URL prop types to accept explicit undefined. |
| src/pages/admin/festivals/info/FestivalFields/FestivalMapField.tsx | Widens optional map URL prop types to accept explicit undefined. |
| src/pages/admin/festivals/info/FestivalFields/FestivalInfoField.tsx | Widens optional info text prop types to accept explicit undefined. |
| src/lib/timelineMountMoment.ts | Widens optional scrollTo type to accept explicit undefined. |
| src/lib/timelineCalculator.ts | Widens optional stage color type to accept explicit undefined. |
| src/lib/scheduleFilter.ts | Widens optional userVotes type to accept explicit undefined. |
| src/hooks/useScheduleData.ts | Widens optional startTime/endTime to accept explicit undefined. |
| src/hooks/use-toast.ts | Widens optional toastId types to accept explicit undefined. |
| src/contexts/FestivalEditionContext.tsx | Widens optional editionSlug type to accept explicit undefined. |
| src/components/ui/sonner.tsx | Adjusts theme prop typing/cast to satisfy stricter optional-property handling. |
| src/components/ui/multi-select.tsx | Widens optional className type to accept explicit undefined. |
| src/components/ui/menubar.tsx | Adjusts checkbox item props handling to avoid exact-optional type issues. |
| src/components/ui/dropdown-menu.tsx | Adjusts checkbox item props handling to avoid exact-optional type issues. |
| src/components/ui/context-menu.tsx | Adjusts checkbox item props handling to avoid exact-optional type issues. |
| src/components/StageBadge.tsx | Widens optional props (stageColor, size, showIcon) to accept explicit undefined. |
| src/components/layout/AppHeader/UserMenu.tsx | Widens optional profile prop type to accept explicit undefined. |
| src/components/layout/AppHeader/UserAvatar.tsx | Widens optional username/email types to accept explicit undefined. |
| src/components/layout/AppHeader/TitleSection.tsx | Widens optional logoUrl type to accept explicit undefined. |
| src/components/layout/AppHeader/FestivalIndicator.tsx | Widens optional props (logoUrl, festivalName) to accept explicit undefined. |
| src/components/filters/FilterToggle.tsx | Widens optional callback type to accept explicit undefined. |
| src/components/ErrorBoundary.tsx | Widens optional error/fallback prop types to accept explicit undefined. |
| src/components/AuthDialog/OtpStep.tsx | Widens optional inviteToken type to accept explicit undefined. |
| src/components/AuthDialog/EmailStep.tsx | Widens optional inviteToken type to accept explicit undefined. |
| src/components/AuthDialog/AuthDialog.tsx | Widens optional inviteToken/groupName types to accept explicit undefined. |
| src/components/ArtistImageLoader.tsx | Widens optional src type to accept explicit undefined. |
| src/components/Admin/ScheduleImport/CsvUploadStep.tsx | Widens optional defaultTimezone type to accept explicit undefined. |
| src/api/voting/useVoteMutation.ts | Widens optional existingVote type to accept explicit undefined. |
| src/api/sets/useUpdateSet.ts | Builds update payload via conditional spreads to omit absent keys (no undefined assignments). |
| src/api/ratings/useRateSet.ts | Widens optional existingRating type to accept explicit undefined. |
| src/api/invites/useGenerateInviteMutation.ts | Builds invite payload via conditional spreads to omit absent keys (no undefined assignments). |
| src/api/groups/useCreateGroup.ts | Omits optional description key when absent to satisfy exact-optional rules. |
| src/api/groups/types.ts | Widens optional profile fields (username, email) to accept explicit undefined. |
| src/api/festivals/useFestivals.ts | Widens optional all parameter typing to accept explicit undefined. |
| src/api/festivals/types.ts | Widens optional all query-key typing to accept explicit undefined. |
| src/api/editions/useFestivalEditionsForFestival.ts | Widens optional all parameter typing to accept explicit undefined. |
| src/api/editions/types.ts | Widens optional all query-key typing to accept explicit undefined. |
| src/api/auth/useUpdateProfile.ts | Omits new_username RPC arg when absent rather than explicitly providing undefined. |
| src/api/auth/useSignInWithOtpMutation.ts | Widens optional inviteToken type to accept explicit undefined. |
| src/api/artist-notes/types.ts | Widens optional author fields to accept explicit undefined. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Playwright test resultsDetails
|
Enables
exactOptionalPropertyTypesintsconfig.app.jsonand fixes the resulting type errors, per #37. Most fixes widen prop/param types to explicitly acceptundefined; mutation payload builders (useUpdateSet,useUpdateProfile,useCreateGroup,useGenerateInviteMutation,parseCsv) now build their objects with conditional spreads instead of assigningundefineddirectly.Closes #37.
Verification
npx tsc --noEmit -p tsconfig.app.json— 0 errorspnpm run lint— 0 errors (2 pre-existing unrelated warnings)pnpm test -- --run— 494/494 passingvalueprop rather than coerce to"")Generated by Claude Code