This is what I do whenever possible. And bonus if your scripting language is statically typed. My projects use TypeScript configurations, with the `config` import statically typed and each configuration file checked against those types. It's a great way to ensure you don't miss a config change for an environment you're not working on at the time.
Many reasons to prefer a static declarative config over a dynamic imperative one. Sometimes the latter makes more sense, but there is very much a need for the niche YAML tries to fill
I want my configuration to be guaranteed to halt for one, I don’t want my configuration to have the ability to open sockets, I don’t want configuration to import business logic or 3rd party modules, etc.