Please confirm you have...
Some files like VSCode settings, typescript.json, are json, but allow comments (similar to json5, but it doesn't allow any of the other features).
Up until now I marked those as json5 for correct highlighting, but recently prettier started formatting json5 in markdown as the "simplest version of json5", which for example included taking the quotes off the keys when they aren't necessary. This will give an invalid JSON with comments in the end. However there's not a correctly highlighting on GitHub for jsonc. So I'm suggesting it here.
https://github.com/prettier/prettier/issues/4611#issuecomment-393461346
2018-05-31
@lildude I think it's worth adding a separate language entry for JSON with comments, because jsonc isn't an isolated case. ESLint supports comments in .eslintrc.json files, and the entire reason we added Sublime configs as a language was a workaround for how comments were being highlighted as errors.
Either we differentiate between "JSON" and "JSON with comments", or we switch to a more lenient grammar for highlighting JSON files (I'd be happy to hack one together, it'd barely take 10-25 minutes).
@Alhadis Go for it. Take your pick which you'd prefer to implement.
On it.
Gonna add it as "JSON with comments", because affecting the highlighting of existing JSON files could be hazardous for code review (an invalid JSON file could slip past a maintainer's notice if a less experienced contributor put a JS comment in JSON code, for example...)
2.5 hours later, I still can't get Bundler co-operating with my system. :sweat: Either I suck or Ruby seriously hates my guts.
Anyway, submitted as #4171. :+1:
Most helpful comment
@lildude I think it's worth adding a separate language entry for JSON with comments, because
jsoncisn't an isolated case. ESLint supports comments in.eslintrc.jsonfiles, and the entire reason we added Sublime configs as a language was a workaround for how comments were being highlighted as errors.Either we differentiate between "JSON" and "JSON with comments", or we switch to a more lenient grammar for highlighting JSON files (I'd be happy to hack one together, it'd barely take 10-25 minutes).