-
-
Notifications
You must be signed in to change notification settings - Fork 480
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(formatter): add option
json.formatter.trailingComma
(#1948)
- Loading branch information
Showing
56 changed files
with
364 additions
and
92 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
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
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
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
35 changes: 35 additions & 0 deletions
35
crates/biome_cli/tests/snapshots/main_commands_format/format_omits_json_trailing_comma.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,35 @@ | ||
--- | ||
source: crates/biome_cli/tests/snap_test.rs | ||
expression: content | ||
--- | ||
## `biome.json` | ||
|
||
```json | ||
{ | ||
"json": { | ||
"parser": { "allowTrailingCommas": true }, | ||
"formatter": { "trailingCommas": "none" } | ||
} | ||
} | ||
``` | ||
|
||
## `file.json` | ||
|
||
```json | ||
{ | ||
"loreum_ipsum_lorem_ipsum": "bar", | ||
"loreum_ipsum_lorem_ipsum": "bar", | ||
"loreum_ipsum_lorem_ipsum": "bar", | ||
"loreum_ipsum_lorem_ipsum": "bar", | ||
"loreum_ipsum_lorem_ipsum": "bar" | ||
} | ||
|
||
``` | ||
|
||
# Emitted Messages | ||
|
||
```block | ||
Formatted 1 file in <TIME>. Fixed 1 file. | ||
``` | ||
|
||
|
35 changes: 35 additions & 0 deletions
35
...biome_cli/tests/snapshots/main_commands_format/format_omits_json_trailing_comma_omit.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,35 @@ | ||
--- | ||
source: crates/biome_cli/tests/snap_test.rs | ||
expression: content | ||
--- | ||
## `biome.json` | ||
|
||
```json | ||
{ | ||
"json": { | ||
"parser": { "allowTrailingCommas": true }, | ||
"formatter": { "trailingCommas": "all" } | ||
} | ||
} | ||
``` | ||
|
||
## `file.json` | ||
|
||
```json | ||
{ | ||
"loreum_ipsum_lorem_ipsum": "bar", | ||
"loreum_ipsum_lorem_ipsum": "bar", | ||
"loreum_ipsum_lorem_ipsum": "bar", | ||
"loreum_ipsum_lorem_ipsum": "bar", | ||
"loreum_ipsum_lorem_ipsum": "bar", | ||
} | ||
|
||
``` | ||
|
||
# Emitted Messages | ||
|
||
```block | ||
Formatted 1 file in <TIME>. Fixed 1 file. | ||
``` | ||
|
||
|
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
Oops, something went wrong.