-
-
Notifications
You must be signed in to change notification settings - Fork 534
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
🐛 Parse error for jsonc files #3696
Comments
It's very difficult to triage the issue without information. Can you please at least share the contents of the file? Can you check if you can replicate the issue in the playground? |
Hi, since this is related to extension, probably can't repro it in the playground. I think any repo using
|
What does your editor detect the file as? Are you sure that you don't have some kind of mapping that tells VS Code that the |
I confirmed the issue also occurs in linux (wsl, ubuntu) and Windows 11. I can repro it to other repo using |
I am sorry @unional, I tried it myself and I can't replicate the issue. So it's possible is something in your internal settings (probably in |
I am going to close this, as we can't replicate it. Again, I advise you to check your settings.json (project, workspace and user). Feel free to open it again once you manage to provide a reproduction and some logs from the Daemon (instructions are attached to the template when you create the issue) |
I found out what the problem is.
Since that would causes false positives, {
"json": {
// `biome` treat `json` as `jsonc` by default.
// That causes false positives and should be avoided.
"parser": {
"allowComments": false,
"allowTrailingCommas": false
}
} https://github.com/repobuddy/repobuddy/blob/main/packages/biome/recommended.jsonc#L16-L20 Now the problem is, i.e. by doing IMO this is a bug. As for why you don't get the error, {
"extends": ["@repobuddy/biome/recommended"]
} You need to run |
Biome doesn't parse JSON files as JSONC files. Did you read this somewhere in our docs? However, some files get a particular treatment, which we document here: https://biomejs.dev/guides/configure-biome/#well-known-files
And that's why it's important to provide a reproduction. Can you please provide a minimal reproduction? It's possible it is a bug, I haven't understood yet what's the issue and where it is. |
https://github.com/repobuddy/repobuddy/tree/biome-jsonc here is the minimal repro. The top level {
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
"json": {
// `biome` treat `json` as `jsonc` by default.
// That causes false positives and should be avoided.
"parser": {
"allowComments": false,
"allowTrailingCommas": false
}
}
} and it fails by itself: |
That's not a minimal reproduction, that's a project. The reason why we ask for a minimal reproduction is because we can remove all the noise from a project, and make sure that there aren't other factors at play. |
I can reproduce the issue seen in the screenshot using the reproduction repo, however I'm moving this to the main repo as it's not an issue with the extension. |
VS Code version
1.90.2
Extension version
2.3.0
Biome version
1.8.3
Operating system
Description
It seems like the extension is trying to parse
jsonc
files asjson
files.Steps to reproduce
update
biome
from1.7.3
to1.8.3
Expected behavior
should work
Does this issue occur when using the CLI directly?
No
Logs
The text was updated successfully, but these errors were encountered: