Why is strict mode required #1755
-
Our projects are a long way away from being able to flip on strict mode. Zod requires strict mode. Is there any compromise? Perhaps some minimum set of options that we can turn on that zod needs. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Mainly because of From the TS docs:
This will cause the inference that Zod can provide to be probably wrong sometimes. The library will work just as normal, but you won't be able to trust the inference. |
Beta Was this translation helpful? Give feedback.
-
You can use Zod without strict mode but the inferred types will be incorrect. Specifically, all object keys will be optional. There may be other unexpected behaviors but that's the main one. If that's okay for your team then you don't need strict mode. |
Beta Was this translation helpful? Give feedback.
You can use Zod without strict mode but the inferred types will be incorrect. Specifically, all object keys will be optional. There may be other unexpected behaviors but that's the main one. If that's okay for your team then you don't need strict mode.