komkom / jsonc Goto Github PK
View Code? Open in Web Editor NEWjson like config with comments.
License: MIT License
json like config with comments.
License: MIT License
I love this project! I'm sharing something related I just found in Visual Studio code. Hope it helps.
JSON with Comments (jsonc)
syntax highlighting is available in Visual Studio Code:
When using default JSON
syntax highlighting in VSCode it complains about comments and about trailing commas:
After switching to JSON with Comments (jsonc)
it validates just fine:
This is what I could find about this validation in VSCode:
Small paragraph in documentation: https://code.visualstudio.com/docs/languages/json#_json-with-comments
It seems that the syntax specification is in: https://github.com/Microsoft/vscode/blob/master/extensions/json/syntaxes/JSONC.tmLanguage.json
Thanks for the project!
Test case
https://gist.github.com/kamathln/26e43eb9552e03939b942bc57721950f
Note carefully after give: "[it
: the string extends and gobbles up the comment. The parser did not complain, nor did it give any output. In the Javascript console, All I see is "success"
Just letting you know the site at https://komkom.github.io/ doesn't seem to exist anymore. Hopefully just a misconfiguration rather than intentional!
I like very much the idea.
Any plan to create a RFC ?
I think it's vital for a proposal like this, in order to be easily accepted by the community
I have very similar idea, I always like with minor extension for JSON to make JSON as main stream config language. Like the way you shared a simple doc about the idea, hopefully JSONC will become a mainstream standard
One idea to add here is to support multi-line String literal with back quote "`" as what defined in ES6, the idea is try to make jsonc as compatible as possible with javascript syntax. So for javascript client can just use eval() to parse the doc (similar as jsonp)
It would be nice to have a jsonc image on docker hub that could be easily used in CI environments, to easily convert jsonc to regular json.
There is a PR for jq
that should provide an example of how to implement.
It looks like from reading that PR that you could then enable auto-builds on docker hub that would automatically build a new docker image on hub.docker.com when code is committed to this github repository.
mux": {
"enabled": false,
"concurrency": -1
}
pos: 1621 invalid identifier
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.