vscode-yaml-plus-json icon indicating copy to clipboard operation
vscode-yaml-plus-json copied to clipboard

Support trailing comma

Open martolini opened this issue 2 years ago • 2 comments

Is your feature request related to a problem? Please describe. When I'm working in python and typescript, a common code convention when writing "json-like" objects is to have trailing commas, i.e;

service = {
    "apiVersion": "v1",
    "kind": "Service",
    "metadata": {"name": "service"},
    "spec": {
        "ports": [{"port": 80, "targetPort": 8000}],
    },
}

This is typically preferred in loads of prettier/black setups.

Describe the solution you'd like It would be excellent if this plugin also handled that input instead of "an error occurred converting content from json".

martolini avatar May 21 '22 07:05 martolini

JSON5 accpts trailing comma (as well as comments etc.)

Because It's one of the promissing data interchange formats and very similar to JSON, I think it's an option worth to considering to implement, but only if the owner is positively considering to introduce 'JSON with Comments' format support. (#18)

qyurila avatar Jun 20 '22 17:06 qyurila

@qyurila in general I would highly consider anything the community requests 🙂 Will have a look at it. Otherwise pull requests are welcome as well.

hilleer avatar Jun 20 '22 17:06 hilleer