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

Commit

Permalink
fix(rome_js_formatter): new expression attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
denbezrukov committed Nov 12, 2022
1 parent 8ff11fc commit 608d973
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 6 deletions.
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,
```


0 comments on commit 608d973

Please sign in to comment.