3 ms·
I agree, but I would recommend JSON5 as the solution. Not YAML or this abomination. JSON5 has many advantages: * Superset of JSON without being wildly differe
by IshKebab 5y ago
I agree, but I would recommend JSON5 as the solution. Not YAML or this abomination.
JSON5 has many advantages:
* Superset of JSON without being wildly different. I know YAML is a superset of JSON but it's completely different too. Insane.
* Unambiguous grammar. YAML has way too many big structure decisions that are made by unclear and minor formatting differences. My work's YAML data is full of single-element lists that shouldn't be lists for example.
* Comments, trailing commas
* It's a subset of Javascript so basically nothing new to learn.
* It has an unambiguous extension (.json5). I think JSONC would be a reasonable option but everyone uses the same extension as JSON (.json) so you can never be sure which you are using. E.g. `tsconfig.json` is JSONC but `package.json` is just JSON (to everyone's annoyance).
* Doesn't add too much of Javascript. I wouldn't recommend JSON6 because it's just making the format too complicated for little benefit.
- rk06 5y agoI would rather recommend jsonc: - it has good editor support (VsCode) - has comments support - Support jsonschema Only thing missing is trailing commas, but i would rather live without trailing commas than tooling support
- IshKebab 5y agoJSONC supports trailing commas. > - it has good editor support (VsCode) Unfortunately it doesn't really because of the extension issue I mentioned. Certain file names (like `tsconfig.json`) are whitelisted to have JSONC support, but any random file `foo.json` will be treated as JSON and give you annoying lints if you put comments and trailing commas in. That's a fairly recent change I think.