ota-meshi / eslint-plugin-jsonc

ESLint plugin for JSON(C|5)? files
https://ota-meshi.github.io/eslint-plugin-jsonc/
MIT License
181 stars 17 forks source link

Question: vscode and JSON5 syntax highlight #256

Open giacomorebonato opened 10 months ago

giacomorebonato commented 10 months ago

This plugin is so good that I'd like to just rely on it when using VSCode instead of using the unmaintained JSON5 extension. To do so I associate .json5 files to JavaScript.

  "files.associations": {
    "*.json5": "javascript"
  },
  "[json5]": {
    "editor.formatOnSave": true,
    "editor.defaultFormatter": "dbaeumer.vscode-eslint"
  },

The problem that I still have is that JS validation is on because of this setting:

"javascript.validate.enable": true,

My wish is to disable this for JSON5, but not for JS files. Has anyone been in this situation before?

giacomorebonato commented 9 months ago

I opened this discussion on the JSON5 codebase: https://github.com/json5/json5/discussions/333 But I am not getting attention.

JSON5 could go very far if it was considered valid JS syntax by VSCode... It could for example support JSDoc or TypeScript typings (https://twitter.com/mattpocockuk/status/1696450304131092791).

VSCode maintainers suggest this should be made on the JSON5 extension, but this goes beyond my current knowledge.

Does anyone have similar views about JSON5? Or are you fine with current tooling?

Aadv1k commented 3 months ago

I would really like this to happen. Currently building a code-editor into my Web App, but it's really annoying to have the editor shout at you for using comments in JSON, even though it is being parsed in the backend as Json5

image