1

My settings.json file shows 3 problems with my settings but I can't find it. My settings is below -

{
    "telemetry.enableTelemetry": false,
    "window.zoomLevel": 1,
    "workbench.iconTheme": "material-icon-theme",
    "workbench.colorTheme": "Community Material Theme Ocean",
    "explorer.confirmDelete": false,
    "javascript.validate.enable": false,
    "[javascript]": {
        "editor.defaultFormatter": "esbenp.prettier-vscode"
    },
    "[javascriptreact]": {
        "editor.defaultFormatter": "esbenp.prettier-vscode"
    },
    "files.associations": {
        "*.js": "javascriptreact"
    },
    "editor.formatOnSave": true,
    "git.enableSmartCommit": true,
    "liveServer.settings.https": {
        "enable": true
    },
    "[html]": {
        "editor.defaultFormatter": "esbenp.prettier-vscode"
    },
}
Mark
  • 143,421
  • 24
  • 428
  • 436
Arka
  • 957
  • 1
  • 8
  • 18
  • What problems are you seeing? – Alejandro Apr 22 '21 at 12:27
  • 1
    There's an extra `,` on the last closing curly brace – sbolel Apr 22 '21 at 12:29
  • @Alejandro not showing exact problems. just became yellow and when I hovered over the settings tab it was saying ` 3 problems in the file` – Arka Apr 22 '21 at 12:31
  • You can use the [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) extension for VSCode to auto-validate your JavaScript/JSON files. – sbolel Apr 22 '21 at 12:35
  • won't it misbehave with flowtype ? i had to use "javascript.validate.enable": false, for flowtype @sbolel – Arka Apr 22 '21 at 12:38
  • if there is a problem the tooltip will give a hint of what to fix – rioV8 Apr 22 '21 at 13:57
  • Copy paste into an online json linter - you usually get better indications of the problems. – Mark Apr 22 '21 at 15:26

1 Answers1

0

so I just removed this part

"liveServer.settings.https": {
        "enable": true
    },

and now no problem is showing. but don't know why

sbolel
  • 3,486
  • 28
  • 45
Arka
  • 957
  • 1
  • 8
  • 18
  • 1
    That's correct. It's because the last property in a JSON list shouldn't have a comma after the closing brace. JSON doesn't support trailing commas - see [this answers to this question](https://stackoverflow.com/questions/201782/can-you-use-a-trailing-comma-in-a-json-object#:~:text=Unfortunately%20the%20JSON%20specification%20does%20not%20allow%20a,end%20up%20with%20code%20that%20looks%20like%20this%3A) – sbolel Apr 22 '21 at 12:31
  • but it is not the last property and after taking it out I've no problem even though my last property has comma @sbolel – Arka Apr 22 '21 at 12:36
  • hmm. The extra comma that I was referring to is after the closing brace of `"[html]": { ... },` – sbolel Apr 22 '21 at 12:39
  • @sbolel it is still there but now there is no problem – Arka Apr 22 '21 at 12:40