vscode icon indicating copy to clipboard operation
vscode copied to clipboard

[JSON] `allowTrailingCommas: true` no longer works

Open flying-sheep opened this issue 5 months ago • 8 comments

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.101.2
  • OS Version: any

Steps to Reproduce:

  1. Follow suggestion in https://github.com/microsoft/vscode/issues/237258#issuecomment-2574854653

Trying to suppress the incorrect jsonc(519) warning about trailing commas doesn’t work. I want to suppress it since it’s visual noise obscuring valid warnings.

flying-sheep avatar Jul 10 '25 15:07 flying-sheep

There hasn't been any changes in that area recently.

I just tried, and it seems to work for me

  • create foo.jsonc
{
  "hello": "world"
}
  • add to settings
  "json.schemas": [
        {
            "fileMatch": [
                "*.jsonc"
            ],
            "schema": {
                "allowTrailingCommas": true
            }
        }
    ]

aeschli avatar Jul 11 '25 15:07 aeschli

How can it work for you and not for me if there were no recent changes?

Maybe you got confused about what this is about, because your foo.jsonc doesn’t seem to contain a trailing comma. This issue is about making this warning go away:

Image

flying-sheep avatar Jul 11 '25 15:07 flying-sheep

When you click on the { } and select 'Show schemas', how many entries are there?

aeschli avatar Jul 11 '25 17:07 aeschli

One:

Image

flying-sheep avatar Jul 14 '25 10:07 flying-sheep

It should also contain an entry like this:

Image

That entry comes from the settings. Make sure you have "json.schemas" in your settings

aeschli avatar Jul 14 '25 12:07 aeschli

I did make sure I have it, that’s why I filed this issue, see “Steps to Reproduce”.

flying-sheep avatar Jul 14 '25 12:07 flying-sheep

Hi, any update here?

flying-sheep avatar Aug 18 '25 11:08 flying-sheep

I just tested it again in the latest version of VS Code, following the steps from https://github.com/microsoft/vscode/issues/255169#issuecomment-3062704112

If it doesn't work for you, please provide similarly detailed steps for me to reproduce

aeschli avatar Dec 10 '25 16:12 aeschli

I don’t see the warning anymore, but the /custom/ schema still doesn’t appear in the list.

flying-sheep avatar Dec 10 '25 17:12 flying-sheep

That's strange, I see it. Maybe a syntax error in you settings.json?

Closing the issue.

aeschli avatar Dec 11 '25 08:12 aeschli