3 ms·
The only 2 things I'd like to add in JSON are trailing commas and comments, and this is already supported in most JSON configs (.eslintrc, .babelrc, ..), it's c
by 11235813213455 4y ago
The only 2 things I'd like to add in JSON are trailing commas and comments, and this is already supported in most JSON configs (.eslintrc, .babelrc, ..), it's called JSONC I believe
- mikepurvis 4y agoA native set type would be nice too, and the syntax for it is obvious— comma separated values like a list, but enclosed in braces like a dict.
- aaaaaaaaaaab 4y agoA set is just a list with a uniqueness constraint. JSON already has a list type.
- Dylan16807 4y agoTo each their own, but I find mandatory quoted keys a pain in the ass, and once you change those three things you're basically at JSON5.
- musicale 4y agoI kind of wish Apple hadn't deprecated NeXT-style property lists and had instead gone in the direction of GNUstep by trying to improve the classic format.
- ttiurani 4y agoAnother name for this is JWCC. IMO very good argument for this feature set here: https://nigeltao.github.io/blog/2021/json-with-commas-comments.html https://nigeltao.github.io/blog/2021/json-with-commas-commen...
- Dylan16807 4y agoNote that that page forgets to actually make an argument against unquoted keys. The "Why not JSON5, JSONC #1, HJSON or HOCON instead?" answer says it's because of "unquoted strings", then links to a section that only talks about unquoted values. JSON5 doesn't have unquoted values.
- Xenoamorphous 4y agoProper support for dates too.
- aseemk 4y ago.babelrc uses JSON5. ;) https://github.com/babel/babel/blob/b1e73d6f961065c56427ffa89c130beea8321d3b/packages/babel-core/src/config/files/configuration.ts#L159-L161 https://github.com/babel/babel/blob/b1e73d6f961065c56427ffa8...