-
-
Notifications
You must be signed in to change notification settings - Fork 503
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
🐛 Tsconfig.json file always throw errors "expected a property but instead found '}'" #237
Comments
The JSON specification does not allow trailing commas, try removing it. {
"extends": "../configs/tsconfig.base.json",
"include": ["src", "../../reset.d.ts"],
"exclude": ["dist", "node_modules"],
"compilerOptions": {
"baseUrl": ".",
- "module": "esnext",
+ "module": "esnext"
}
} |
For whoever comes here and sees the issue, the trailing comma is not part of the JSON specifications, but VSCode client allows to do that for a specific number of files. This is not a biome issue, although we have a proposal to implement this in the parser: #129 |
@ematipico |
Yes, we do have these kinds of files, although I am not sure where to document them: biome/crates/biome_service/src/file_handlers/mod.rs Lines 48 to 64 in 7d9080c
Yes, biome/crates/biome_fs/src/fs/os.rs Line 244 in 7d9080c
|
@ematipico |
That's a good question, and that's because I had forgotten that it was ignored! 😜🤣😅 I think it makes sense to add this information to the website, not sure where though. Do you have any suggestion? |
I'm glad I could be of help in some small way! :)
As far as I could find, the description of jsonc is here (https://biomejs.dev/blog/biome-v1/#jsonc-support-and-comments). It does not appear to be in the documentation (https://biomejs.dev/*). If you want to add about these explanations in the documentation, why not create a page under Guides (https://biomejs.dev/guides/*)? |
I believe, initially, we ignored
Good suggestion, I will do it |
I have similar problems with |
@ghiscoding You can use |
oh ok that's good to know but that won't that completely ignore the entire file so if I break the JSON format in the future, let say I remove a comma at the end of a property, then I'm guessing that Biome won't detect the broken file. Anyway, at the end of the day, I just removed the comment on top of the file and Biome was happy, I just thought of mentioning it in here as a use case since many developers will face this one day or another. So an exception for any VSCode files would be better (not just Thanks |
Environment information
Note:
Here is the full output I printed to the .txt file(sorry, the file is 25mbs --> I uploaded this file to the Easyupload --> https://easyupload.io/tv6oym
What happened?
The repo is open-source --> You can pull to the local and check directly https://github.com/techmely/monorepo/blob/main/packages/utils/tsconfig.json
Expected result
Should work correctly 😆. Thank for your work <3 I love this product!
Code of Conduct
The text was updated successfully, but these errors were encountered: