0

Using prettier , the code snippets files in vscode end upp having red lines because those files are json with comments. The language mode for those files in vscode is set to "Code snippets", but if I change it to "jsonc", the red lines go away. But this change reverts back to "Code snippets" after a while after restarting.

So I thought I could make prettier interpret the "Code snippets" as jsonc:

I created a .prettierrc file with this info:

{
 "overrides": [
 {
 "files": "**/snippets/*.json",
 "options": {
 "parser": "jsonc"
 }
 }
 ]
}

The snippets files are in a nested file path in a "snippets" folder. But it didn't work, I also tried "files": "snippets/*.json".

Can it be achieved in some way?

asked Mar 18 at 10:56
1
  • this can probably be solved with prettier config(?) prettier apparently supports jsonc since 3.2 Commented Mar 19 at 3:10

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.