Skip to content
This repository has been archived by the owner on Apr 11, 2020. It is now read-only.

adding comments in json files #13

Closed
lucamorelli opened this issue Mar 7, 2015 · 3 comments
Closed

adding comments in json files #13

lucamorelli opened this issue Mar 7, 2015 · 3 comments

Comments

@lucamorelli
Copy link

Using the comment selection keyboard shortcut inside the json file the // comment is added.
This is wrong and running for example the bower install task with comments in the bower.json I obtain the message Fatal error: Failed to read ...\bower.json

@glen-84
Copy link

glen-84 commented May 5, 2015

Microsoft should push for comments to be included in the JSON spec. The reasons for it not being included are weak.

@madskristensen
Copy link
Contributor

@lucamorelli Comments are being flagged as invalid if used in bower.json and package.json since Visual Studio 2015 RC.

@glen-84 Comments are not illegal according to the JSON spec directly. The spec outlines what is valid JSON but states that parsers can expand the feature set as long as they also support the JSON spec.

@glen-84
Copy link

glen-84 commented May 5, 2015

@madskristensen,

Comments were once part of the spec (see here).

The moment a parser expands the feature set, the document can no longer be parsed by other parsers. It's not at all intuitive that you can comment in project.json but not in bower.json or package.json. This is why it should be part of the spec once again, and why I thought it would be interesting to see how the spec writers would respond to such a request from a large corporation.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants