How to prevent TypeScript from allowing incompatible types when using index signatures and optional keys?
I’m encountering an issue where TypeScript doesn’t catch a type mismatch when using an index signature type with a more specific type where some keys are optional but with a different type. Here’s a simplified example: