Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 allowComments default setting error in json parser #5111

Closed
1 task done
JinuYong opened this issue Feb 13, 2025 · 4 comments
Closed
1 task done

🐛 allowComments default setting error in json parser #5111

JinuYong opened this issue Feb 13, 2025 · 4 comments
Labels
S-Needs triage Status: this issue needs to be triaged

Comments

@JinuYong
Copy link

JinuYong commented Feb 13, 2025

Environment information

biome rage
CLI:
  Version:                      1.9.4
  Color support:                true

Platform:
  CPU Architecture:             aarch64
  OS:                           macos

Environment:
  BIOME_LOG_PATH:               unset
  BIOME_LOG_PREFIX_NAME:        unset
  BIOME_CONFIG_PATH:            unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v22.13.1"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         unset

Biome Configuration:
  Status:                       Loaded successfully
  Formatter disabled:           false
  Linter disabled:              false
  Organize imports disabled:    false
  VCS disabled:                 true

Workspace:
  Open Documents:               0

What happened?

  1. install biome in new vite project
  2. run 'biome init'
  3. tsconfig.app.json file is treated as json, not jsonc
Image
  1. add 'allowComments' setting in biome.json, the error disappear in tsconfig.app.json
Image
  1. even if i removed all the values in biome.json, it still cause same error
Image
  1. if i delete biome.json or set allowComments option to true in biome.json, error is solved

Expected result

The default value of the allowComments option is true, so I think the tsconfig.app.json file should be automatically treated as a jsonc file

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@JinuYong JinuYong added the S-Needs triage Status: this issue needs to be triaged label Feb 13, 2025
@Jinu0827 Jinu0827 marked this as a duplicate of #5110 Feb 13, 2025
@ematipico
Copy link
Member

The reason why VSCode doesn't show you errors for the TypeScript configuration, is because it treats JSON files as JSONC files.

However, we prefer to stick with the standard. Regardless, in V2, files named tsconfig.*.json will be automatically treated as JSONC files by Biome

@Jinu0827
Copy link

The reason why VSCode doesn't show you errors for the TypeScript configuration, is because it treats JSON files as JSONC files.

However, we prefer to stick with the standard. Regardless, in V2, files named tsconfig.*.json will be automatically treated as JSONC files by Biome

Hi, Thanks for the explanation

So, am I to understand that it is normal behavior to get a comment error in the tsconfig.*.json file if the allowComments option is not written in the biome.json file, not in V2.0?

@ematipico
Copy link
Member

Yes that's normal. By standards, JSON doesn't allow comments

@Jinu0827
Copy link

I understand, Thanks! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-Needs triage Status: this issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

3 participants