starter icon indicating copy to clipboard operation
starter copied to clipboard

bug: comments not allowed in wrangler.json, change the format to jsonc

Open MathurAditya724 opened this issue 1 year ago • 3 comments

VSCode provides an error for the comments in the wranger.json, changing it to .jsonc resolves the issue. We have 2 options to resolve this -

  1. Either change the format
  2. Or, remove the comments from the template (I don't like this tho)

I understand that many might not be familiar with the .jsonc format, so I wanted to bring this issue to everyone's attention and get your opinion.

Image

MathurAditya724 avatar Feb 01 '25 14:02 MathurAditya724

Hi @MathurAditya724

Thank you for the issue.

My environment, my VSCode, does not show the error. And, the "Hello World" project that does not use Hono created by Create Cloudflare CLI uses wrangler.json not .jsonc It also does not throw the error.

Image

Is this because my environment is different from yours, or do you need to make some setting?

yusukebe avatar Feb 01 '25 22:02 yusukebe

I just checked again, and it turns out that my linter, biome, was giving me the error. Sorry for the false alarm.

I'm just curious if we should remove the comments in .json, as we have defined the schema and are getting the IntelliSense.

MathurAditya724 avatar Feb 02 '25 03:02 MathurAditya724

@MathurAditya724

Thank you for checking it.

I'm just curious if we should remove the comments in .json, as we have defined the schema and are getting the IntelliSense.

I also thought that! The schema showing complement is good. But it will be more helpful to have comments. I want to know the opinions of others.

yusukebe avatar Feb 02 '25 03:02 yusukebe