core
core copied to clipboard
Enable the flag `exactOptionalPropertyTypes`
The TypeScript flag exactOptionalPropertyTypes has been enabled, which causes TypeScript to distinguish between object properties that don't exist and properties that are set to undefined. This improves type safety for operations that iterate over keys.
This is blocked by https://github.com/KeystoneHQ/ur-registry/issues/21
Revisiting this PR. It would be nice to have this.
I'm wondering if there is a way we can get around the issue with ur-registry as I see exactOptionalPropertyTypes has not been enabled there yet. Perhaps we can define our own type definitions and get TypeScript to honor them rather than needing to honor ur-registry?