Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use json5 for settings files #6199

Closed
jasongrout opened this issue Apr 13, 2019 · 3 comments
Closed

Use json5 for settings files #6199

jasongrout opened this issue Apr 13, 2019 · 3 comments

Comments

@jasongrout
Copy link
Contributor

@jasongrout jasongrout commented Apr 13, 2019

We currently use comment-json (https://www.npmjs.com/package/comment-json) to do our parsing of settings files so that we can support comments. It looks like a much more popular way to have comments is to use the json5 library: https://www.npmjs.com/package/json5. Compare 39k downloads a week (comment-json) to 13 million downloads a week (json5)

Perhaps we should just switch to json5.

Here is some place we are using comment-json:

import * as json from 'comment-json';

user = json.parse(plugin.raw, null, strip) as JSONObject;
(and a few more places in the file)

CC @afshin

@jasongrout jasongrout added this to the 1.0 milestone Apr 13, 2019
@jasongrout jasongrout changed the title Use json5 for settings files? Use json5 for settings files Apr 13, 2019
@ian-r-rose
Copy link
Member

@ian-r-rose ian-r-rose commented Apr 18, 2019

Somewhat besides the point, but I really like json5 and wish it were just JSON. I would never look at YAML again...

@blink1073
Copy link
Member

@blink1073 blink1073 commented Apr 19, 2019

In Python we have setup.py (executable config), setup.cfg (ini), requirements.txt (ini-like), and pyproject.toml (TOML, kind of an ini). On almost every work project I've been on we've used yaml.

My ideal world would just use json5 for all the things. import json; json.dumps() would have to work too... /rant

@lock
Copy link

@lock lock bot commented Aug 6, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related discussion.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants