microsoft / ts-gyb

Generating native code interfaces from TypeScript
MIT License
124 stars 16 forks source link

Is YML a better choice for configuration file? #69

Open haojianzong opened 3 years ago

haojianzong commented 3 years ago

Currently we are using JSON, but YML requires less characters and is easier to modify in CLI. What do you think?

Example from a similar code generator lib: https://github.com/krzysztofzablocki/Sourcery/blob/master/SourceryTests/Stub/Configs/multi.yml

haven2world commented 3 years ago

I think we can support both? But we'd better keep JSON, for many front-end engineers, they're more familiar with JSON and maybe have no idea what yml is.

imWildCat commented 3 years ago

yaml is also good. I think we can find a way to support both yaml, json and even TypeScript (example).

IMO, these configuration files are portable to difference languages. For example, https://github.com/spf13/viper is a Golang configuration solution for

JSON, TOML, YAML, HCL, envfile and Java properties config files