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

fix(rome_js_formatter): new expression attribute #3686

Merged
merged 1 commit into from
Nov 13, 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
Expand Up @@ -89,7 +89,6 @@ pub(crate) fn should_inline_jsx_expression(
| JsObjectExpression(_)
| JsArrowFunctionExpression(_)
| JsCallExpression(_)
| JsNewExpression(_)
| JsImportCallExpression(_)
| ImportMeta(_)
| JsFunctionExpression(_)
Expand Down
10 changes: 5 additions & 5 deletions crates/rome_js_formatter/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -787,11 +787,11 @@ function() {
// use this test check if your snippet prints as you wish, without using a snapshot
fn quick_test() {
let src = r#"
const a = [
longlonglonglongItem1longlonglonglongItem1,
longlonglonglongItem1longlonglonglongItem2,
longlonglonglongItem1longlonglonglongItem3,
];
<OtherComponent
value={
new Set(veryLongConditionZzzzzzzzzzzzzzzzzveryLongConditionZzzzzzzzzzzzzzzzzveryLongConditionZzzzzzzzzzzzzzzzz)
}
/>

"#;
let syntax = SourceType::tsx();
Expand Down
6 changes: 6 additions & 0 deletions crates/rome_js_formatter/tests/specs/jsx/attributes.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,9 @@ const a = <Popconfirm
<span>Delete</span>
</Popconfirm>
;

<OtherComponent
value={
new Set(veryLongConditionZzzzzzzzzzzzzzzzzveryLongConditionZzzzzzzzzzzzzzzzzveryLongConditionZzzzzzzzzzzzzzzzz)
}
/>
15 changes: 15 additions & 0 deletions crates/rome_js_formatter/tests/specs/jsx/attributes.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ const a = <Popconfirm
</Popconfirm>
;

<OtherComponent
value={
new Set(veryLongConditionZzzzzzzzzzzzzzzzzveryLongConditionZzzzzzzzzzzzzzzzzveryLongConditionZzzzzzzzzzzzzzzzz)
}
/>

```


Expand Down Expand Up @@ -176,6 +182,14 @@ const a = (
</Popconfirm>
);

<OtherComponent
value={
new Set(
veryLongConditionZzzzzzzzzzzzzzzzzveryLongConditionZzzzzzzzzzzzzzzzzveryLongConditionZzzzzzzzzzzzzzzzz,
)
}
/>;


## Unimplemented nodes/tokens

Expand All @@ -187,6 +201,7 @@ const a = (

10: "ui-monospace,SFMono-Regular,SF Mono,Consolas,Liberation Mono,Menlo,monospace",
30: "ui-monospace,SFMono-Regular,SF Mono,Consolas,Liberation Mono,Menlo,monospace",
85: veryLongConditionZzzzzzzzzzzzzzzzzveryLongConditionZzzzzzzzzzzzzzzzzveryLongConditionZzzzzzzzzzzzzzzzz,
```