.yaml, .toml, etc?
Whatever. Comments are helpful, which makes pure JSON a poor choice. JSON5 or JSON-C are better, but linting and static analysis are important to every form of code, so make sure that what you use for that will understand your syntax.
My current preference is generally TOML, but Iβve started dabbling with custom HCL2 DSLs. (I write a lot of Go and Terraform.)
Need it to be user editable in a text editor? YAML. Otherwise, JSON.
No reason to go beyond simple key-value format like dotenv or just env variables. If you need more structure then maybe you are confusing configuration with state and this is not really the same thing.