Apologies if this isn't the right place - it's not, feel free to redirect me to where the right place is.
I propose we extend JSON with comments using JS's grammar:
- Single-line comments start with
//and end with line terminator sequences (CR, LF, LS, or PS).
- Multi-line comments start with
/*and end with
- Implementations should (not "must") treat this as equivalent to whitespace.
Despite the extremely performance-sensitive nature of JSON parsers, I don't anticipate this to cause performance problems to existing parsers.
I don't really need to state the demand here (just search "json with comments" and it'll show up within the first page), and many things (ranging from ESLint and npm to Visual Studio and even Chrome in a few places) support it already. .NET has native support for it (off by default) in its built-in JSON parser. There's also many spec extensions providing just that. I feel at this point it's time to place it in the language proper, RFC update and all. If anything, it's already starting to result in a partial ecosystem fork (.NET's standard library and the increasing use of JSON5 in place of native JSON are evidence of this), and that's not exactly a good thing for interoperability.