Comments (4)
The reason json is formatted as jsonc is because people often have comments in their json codeblocks, which isn't part of the specification.
But I just did a quick test and it seems that both prettier and deno supports formatting json files with comments. Sadly Biome does not expose the argument for allowing comments (https://github.com/biomejs/biome/blob/a6f5f0e8187912b389bf88ece65a51f1e02027a6/crates/biome_service/src/configuration/json.rs#L31).
I was already planning on introducing language โflavorsโ (css -> css, scss, sass, less
, json -> json, jsonc, json5
, sh -> sh, zsh, bash
), which should fix the issue.
from mdsf.
The point I raised in #146 is interesting here as I have no way to know what formatter is being applied.
from mdsf.
It seems to me you are using jsonc format which supports comments and extra trailing comma
These two formats should be handled separately.
```json
{
"foo": "bar",
"user_id": "2313",
"scope": ["internal"]
}
```
```jsonc
{
"foo": "bar",
"user_id": "2313",
"scope": ["internal"] // some comment
}
```
from mdsf.
it might be related to this prettier/prettier#15956
so you will have to allow "allowTrailingCommas" for jsonc formatter and allowTrailingCommas=false for regular json
Or maybe the "bug" is already fixed, are you up 2 date on prettier ?
from mdsf.
Related Issues (20)
- Feature request: add a `--dry-run` mode
- Multithread support
- [markdown] Support "autocorrect" tool HOT 1
- [Markdown] Support "misspell"
- [Go] support golines formatter
- Add support for custom file extensions
- Add --cache argument
- Use binaries from node_modules
- Add support for composer based binaries
- Shell script for installing binary
- Publish binary to npm
- Generate manpage
- Shell completions for nushell
- Shell completions for fig
- Standardjs does not work because files are in hidden folder
- Support stdin/stdout based formatters
- Allow settings extra flags to formatter
- Setup codecoverage tracking
- Vs Code extension for format on save
- Obsidian extension
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mdsf.