+
Skip to content
This repository was archived by the owner on Aug 31, 2023. It is now read-only.

test(rome_js_formatter): Document array-fill comments difference #3130

Merged
merged 1 commit into from
Aug 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[
// Prettier prints the `-2` element on the same line as the `-3`.
// This is the case because Prettier doesn't add virtual groups around `fill` elements, making it return `true` when it
// encounters the first hard line break. As it happens, this line comment contains a hard line break, making
// Prettier believe that the `-3` with this leading comment all fits on the line, which, obviously, isn't the case.
-3,
-2
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
source: crates/rome_js_formatter/tests/spec_test.rs
expression: fill-array-comments.js
---
# Input
[
// Prettier prints the `-2` element on the same line as the `-3`.
// This is the case because Prettier doesn't add virtual groups around `fill` elements, making it return `true` when it
// encounters the first hard line break. As it happens, this line comment contains a hard line break, making
// Prettier believe that the `-3` with this leading comment all fits on the line, which, obviously, isn't the case.
-3,
-2
]

=============================
# Outputs
## Output 1
-----
Indent style: Tab
Line width: 80
Quote style: Double Quotes
Quote properties: As needed
-----
[
// Prettier prints the `-2` element on the same line as the `-3`.
// This is the case because Prettier doesn't add virtual groups around `fill` elements, making it return `true` when it
// encounters the first hard line break. As it happens, this line comment contains a hard line break, making
// Prettier believe that the `-3` with this leading comment all fits on the line, which, obviously, isn't the case.
-3,
-2,
];


## Lines exceeding width of 80 characters

3: // This is the case because Prettier doesn't add virtual groups around `fill` elements, making it return `true` when it
4: // encounters the first hard line break. As it happens, this line comment contains a hard line break, making
5: // Prettier believe that the `-3` with this leading comment all fits on the line, which, obviously, isn't the case.

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载