Comments in JSON files
See original GitHub issueHello, myjson
files have comments, I don’t want to delete them. But your plugin doesn’t format files with comments.
For example, beginning of my file:
[
// Scroll bar
{
"class": "scroll_bar_control",
"layer0.tint": [0, 250, 154],
"layer0.opacity": 1,
},
When I try to format a code, in Status Bar appears:
Expecting object: line 2 column 5 (char 6),
If I type in this file in the command palette Pretty JSON: Validate
, a dialog box appears with the inscription:
Invalid JSON
In files that do not contain comments JSON is valid
. How can I format my file contains comments?
Thanks.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:6
Top Results From Across the Web
JSON Comment Example — How to Comment in JSON Files
A way to skirt around the comments issue is to add data to your JSON file that function as comments. ... Here's another...
Read more >Can comments be used in JSON? - Stack Overflow
JSON does not support comments natively, but you can make your own decoder or at least preprocessor to strip out comments ...
Read more >Multiple ways to write JSON Comments - W3schools.io
One way is using adding key-value pairs with comments and descriptions JSOn always contains data of keys and values, so add the comments...
Read more >commentjson - Add comments in JSON files — commentjson ...
commentjson allows you to deserialize JSON files with Python and JavaScript style comments in them. commentjson 's API is the same as the...
Read more >How to write comments inside a JSON document - Quora
Comments are not supported in JSON documents. This decision was taken by its designer Douglas Crockford because people were using them to hold...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Kristinita, I saw it and disagree!
@sweetw0r , see my previous comment.
Thanks.