Background
exactOptionalPropertyTypes is a TypeScript strictness flag. It changes optional properties so that name?: string means the key may be absent — but you can no longer explicitly assign undefined to it.
type T = { name?: string };
const a: T = { name: undefined }; // OK today, ERROR with the flag
const b: T = {}; // OK either way
This catches the genuine distinction between "key absent" and "key explicitly undefined", which matters for Object.keys(), spreads, in checks, etc.
Why it's a separate task
- It is repo-wide hardening: enabling it would surface type errors across many files, not a localized change.
- It conflicts with patterns already in the codebase. For example, the mutation payloads in
useUpdateSet.ts / useUpdateArtist.ts build a single object literal that assigns possibly-undefined values directly (relying on JSON serialization to drop them). With the flag on, those would need to go back to conditional/guarded construction.
Suggested approach
- Enable
exactOptionalPropertyTypes in tsconfig.app.json.
- Run
pnpm run typecheck, triage the resulting errors.
- Fix incrementally, or decide it is not worth the churn.
Context
Came up during PR #34 review while refactoring set/artist mutation payloads. Tracking separately so the decision is deliberate rather than bundled into an unrelated PR.
Background
exactOptionalPropertyTypesis a TypeScript strictness flag. It changes optional properties so thatname?: stringmeans the key may be absent — but you can no longer explicitly assignundefinedto it.This catches the genuine distinction between "key absent" and "key explicitly
undefined", which matters forObject.keys(), spreads,inchecks, etc.Why it's a separate task
useUpdateSet.ts/useUpdateArtist.tsbuild a single object literal that assigns possibly-undefinedvalues directly (relying on JSON serialization to drop them). With the flag on, those would need to go back to conditional/guarded construction.Suggested approach
exactOptionalPropertyTypesintsconfig.app.json.pnpm run typecheck, triage the resulting errors.Context
Came up during PR #34 review while refactoring set/artist mutation payloads. Tracking separately so the decision is deliberate rather than bundled into an unrelated PR.