core icon indicating copy to clipboard operation
core copied to clipboard

Enable the flag `exactOptionalPropertyTypes`

Open Gudahtt opened this issue 3 years ago • 1 comments

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.

Gudahtt avatar Apr 22 '22 20:04 Gudahtt

This is blocked by https://github.com/KeystoneHQ/ur-registry/issues/21

Gudahtt avatar Apr 22 '22 20:04 Gudahtt

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?

mcmire avatar Jul 28 '23 18:07 mcmire