forked from rome/tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(rome_json_formatter): JSON formatter does not respect lineWidth f…
…or arrays rome#4351
- Loading branch information
1 parent
5367d89
commit 958067e
Showing
10 changed files
with
161 additions
and
20 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
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
3 changes: 3 additions & 0 deletions
3
crates/rome_json_formatter/tests/specs/json/array/fill_layout.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,3 @@ | ||
[ | ||
123231321, 123213213, 12312321, 12321123211232112321, 12321321, 1232132112321321123213211232132112321321 | ||
] |
34 changes: 34 additions & 0 deletions
34
crates/rome_json_formatter/tests/specs/json/array/fill_layout.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,34 @@ | ||
--- | ||
source: crates/rome_formatter_test/src/snapshot_builder.rs | ||
info: json/array/fill_layout.json | ||
--- | ||
|
||
# Input | ||
|
||
```json | ||
[ | ||
123231321, 123213213, 12312321, 12321123211232112321, 12321321, 1232132112321321123213211232132112321321 | ||
] | ||
``` | ||
|
||
|
||
============================= | ||
|
||
# Outputs | ||
|
||
## Output 1 | ||
|
||
----- | ||
Indent style: Tab | ||
Line width: 80 | ||
----- | ||
|
||
```json | ||
[ | ||
123231321, 123213213, 12312321, 12321123211232112321, 12321321, | ||
1232132112321321123213211232132112321321 | ||
] | ||
``` | ||
|
||
|
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
11 changes: 11 additions & 0 deletions
11
crates/rome_json_formatter/tests/specs/json/array/one_per_line_layout.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,11 @@ | ||
{ | ||
"boolean": [ | ||
true, true, true, true, true, true, true, true, false, false, false, true, false, false | ||
], | ||
"strings": [ | ||
"longlongstringlonglongstring", "12312321", "longlongstringlonglongstring" | ||
], | ||
"null": [ | ||
null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null | ||
] | ||
} |
81 changes: 81 additions & 0 deletions
81
crates/rome_json_formatter/tests/specs/json/array/one_per_line_layout.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,81 @@ | ||
--- | ||
source: crates/rome_formatter_test/src/snapshot_builder.rs | ||
info: json/array/one_per_line_layout.json | ||
--- | ||
|
||
# Input | ||
|
||
```json | ||
{ | ||
"boolean": [ | ||
true, true, true, true, true, true, true, true, false, false, false, true, false, false | ||
], | ||
"strings": [ | ||
"longlongstringlonglongstring", "12312321", "longlongstringlonglongstring" | ||
], | ||
"null": [ | ||
null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null | ||
] | ||
} | ||
``` | ||
|
||
|
||
============================= | ||
|
||
# Outputs | ||
|
||
## Output 1 | ||
|
||
----- | ||
Indent style: Tab | ||
Line width: 80 | ||
----- | ||
|
||
```json | ||
{ | ||
"boolean": [ | ||
true, | ||
true, | ||
true, | ||
true, | ||
true, | ||
true, | ||
true, | ||
true, | ||
false, | ||
false, | ||
false, | ||
true, | ||
false, | ||
false | ||
], | ||
"strings": [ | ||
"longlongstringlonglongstring", | ||
"12312321", | ||
"longlongstringlonglongstring" | ||
], | ||
"null": [ | ||
null, | ||
null, | ||
null, | ||
null, | ||
null, | ||
null, | ||
null, | ||
null, | ||
null, | ||
null, | ||
null, | ||
null, | ||
null, | ||
null, | ||
null, | ||
null, | ||
null, | ||
null | ||
] | ||
} | ||
``` | ||
|
||
|