Three months ago I started validating every config file at process start using a schema library. Yesterday I added one to a 100-line script and immediately regretted it. The line between the two is worth being honest about.
The rule that’s actually working
If a config value is read from disk and consumed by more than one module, validate it on load. Otherwise, just read it.
That’s it. The benefit of validation isn’t catching typos — TypeScript does most of that already — it’s keeping the shape of the parsed object honest across module boundaries. Once a config object is being passed around, you want a guarantee at its origin.
What’s not working
Reaching for schemas in tiny scripts where the config is read in one place, used in one place, and discarded. The schema is dead weight there, both at runtime and at read-time for the next person.