-
-
Notifications
You must be signed in to change notification settings - Fork 508
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(formatter): no trailing commas in JSON files
- Loading branch information
Showing
21 changed files
with
362 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
cli: major | ||
--- | ||
|
||
# The Biome formatter doesn't add a trailing command in `.json` files, even when `json.formatter.trailingCommas` is set to `true` |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,47 @@ | ||
[package] | ||
authors.workspace = true | ||
authors.workspace = true | ||
categories.workspace = true | ||
description = "Biome's JSON formatter" | ||
edition.workspace = true | ||
homepage.workspace = true | ||
keywords.workspace = true | ||
license.workspace = true | ||
name = "biome_json_formatter" | ||
description = "Biome's JSON formatter" | ||
edition.workspace = true | ||
homepage.workspace = true | ||
keywords.workspace = true | ||
license.workspace = true | ||
name = "biome_json_formatter" | ||
repository.workspace = true | ||
version = "0.5.7" | ||
version = "0.5.7" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
biome_deserialize = { workspace = true } | ||
biome_deserialize = { workspace = true } | ||
biome_deserialize_macros = { workspace = true } | ||
biome_diagnostics = { workspace = true } | ||
biome_formatter = { workspace = true } | ||
biome_json_syntax = { workspace = true } | ||
biome_rowan = { workspace = true } | ||
biome_suppression = { workspace = true } | ||
camino = { workspace = true } | ||
schemars = { workspace = true, optional = true } | ||
serde = { workspace = true, features = ["derive"], optional = true } | ||
biome_diagnostics = { workspace = true } | ||
biome_formatter = { workspace = true } | ||
biome_json_syntax = { workspace = true } | ||
biome_rowan = { workspace = true } | ||
biome_suppression = { workspace = true } | ||
camino = { workspace = true } | ||
schemars = { workspace = true, optional = true } | ||
serde = { workspace = true, features = ["derive"], optional = true } | ||
|
||
[dev-dependencies] | ||
biome_formatter_test = { path = "../biome_formatter_test" } | ||
biome_fs = { path = "../biome_fs" } | ||
biome_json_parser = { path = "../biome_json_parser" } | ||
biome_parser = { path = "../biome_parser" } | ||
biome_service = { path = "../biome_service" } | ||
countme = { workspace = true, features = ["enable"] } | ||
serde_json = { workspace = true } | ||
tests_macros = { path = "../tests_macros" } | ||
biome_fs = { path = "../biome_fs" } | ||
biome_json_parser = { path = "../biome_json_parser" } | ||
biome_parser = { path = "../biome_parser" } | ||
biome_service = { path = "../biome_service" } | ||
countme = { workspace = true, features = ["enable"] } | ||
serde_json = { workspace = true } | ||
tests_macros = { path = "../tests_macros" } | ||
biome_test_utils = { path = "../biome_test_utils" } | ||
|
||
# cargo-workspaces metadata | ||
[package.metadata.workspaces] | ||
independent = true | ||
|
||
[features] | ||
schema = ["dep:schemars", "serde"] | ||
serde = ["dep:serde"] | ||
serde = ["dep:serde"] | ||
|
||
[lints] | ||
workspace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
crates/biome_json_formatter/tests/specs/json/trailing_comma_never/classic.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"list": [], | ||
"list1": [], | ||
"list2": [], | ||
"list3": [], | ||
"list4": [] | ||
} |
62 changes: 62 additions & 0 deletions
62
crates/biome_json_formatter/tests/specs/json/trailing_comma_never/classic.json.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
--- | ||
source: crates/biome_formatter_test/src/snapshot_builder.rs | ||
info: json/trailing_comma_never/classic.json | ||
snapshot_kind: text | ||
--- | ||
# Input | ||
|
||
```json | ||
{ | ||
"list": [], | ||
"list1": [], | ||
"list2": [], | ||
"list3": [], | ||
"list4": [] | ||
} | ||
``` | ||
|
||
|
||
============================= | ||
|
||
# Outputs | ||
|
||
## Output 1 | ||
|
||
----- | ||
Indent style: Tab | ||
Indent width: 2 | ||
Line ending: LF | ||
Line width: 80 | ||
Trailing commas: None | ||
----- | ||
|
||
```json | ||
{ | ||
"list": [], | ||
"list1": [], | ||
"list2": [], | ||
"list3": [], | ||
"list4": [] | ||
} | ||
``` | ||
|
||
## Output 1 | ||
|
||
----- | ||
Indent style: Tab | ||
Indent width: 2 | ||
Line ending: LF | ||
Line width: 80 | ||
Trailing commas: All | ||
----- | ||
|
||
```json | ||
{ | ||
"list": [], | ||
"list1": [], | ||
"list2": [], | ||
"list3": [], | ||
"list4": [] | ||
} | ||
``` |
7 changes: 7 additions & 0 deletions
7
crates/biome_json_formatter/tests/specs/json/trailing_comma_never/classic.jsonc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"list": [], | ||
"list1": [], | ||
"list2": [], | ||
"list3": [], | ||
"list4": [], | ||
} |
62 changes: 62 additions & 0 deletions
62
crates/biome_json_formatter/tests/specs/json/trailing_comma_never/classic.jsonc.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
--- | ||
source: crates/biome_formatter_test/src/snapshot_builder.rs | ||
info: json/trailing_comma_never/classic.jsonc | ||
snapshot_kind: text | ||
--- | ||
# Input | ||
|
||
```jsonc | ||
{ | ||
"list": [], | ||
"list1": [], | ||
"list2": [], | ||
"list3": [], | ||
"list4": [], | ||
} | ||
``` | ||
|
||
|
||
============================= | ||
|
||
# Outputs | ||
|
||
## Output 1 | ||
|
||
----- | ||
Indent style: Tab | ||
Indent width: 2 | ||
Line ending: LF | ||
Line width: 80 | ||
Trailing commas: None | ||
----- | ||
|
||
```jsonc | ||
{ | ||
"list": [], | ||
"list1": [], | ||
"list2": [], | ||
"list3": [], | ||
"list4": [] | ||
} | ||
``` | ||
|
||
## Output 1 | ||
|
||
----- | ||
Indent style: Tab | ||
Indent width: 2 | ||
Line ending: LF | ||
Line width: 80 | ||
Trailing commas: All | ||
----- | ||
|
||
```jsonc | ||
{ | ||
"list": [], | ||
"list1": [], | ||
"list2": [], | ||
"list3": [], | ||
"list4": [], | ||
} | ||
``` |
Oops, something went wrong.