fix(rome_js_formatter): new expression attribute
Fix
MODIFY
crates/rome_js_formatter/src/jsx/attribute/expression_attribute_value.rs
crates/rome_js_formatter/src/jsx/attribute/expression_attribute_value.rs
@@ -89,7 +89,6 @@ pub(crate) fn should_inline_jsx_expression(
| JsObjectExpression(_)
| JsArrowFunctionExpression(_)
| JsCallExpression(_)
- | JsNewExpression(_)
| JsImportCallExpression(_)
| ImportMeta(_)
| JsFunctionExpression(_)

MODIFY
crates/rome_js_formatter/src/lib.rs
crates/rome_js_formatter/src/lib.rs
@@ -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();

MODIFY
crates/rome_js_formatter/tests/specs/jsx/attributes.jsx
crates/rome_js_formatter/tests/specs/jsx/attributes.jsx
@@ -68,3 +68,9 @@ const a = <Popconfirm
<span>Delete</span>
</Popconfirm>
;
+
+<OtherComponent
+ value={
+ new Set(veryLongConditionZzzzzzzzzzzzzzzzzveryLongConditionZzzzzzzzzzzzzzzzzveryLongConditionZzzzzzzzzzzzzzzzz)
+ }
+/>

MODIFY
crates/rome_js_formatter/tests/specs/jsx/attributes.jsx.snap
crates/rome_js_formatter/tests/specs/jsx/attributes.jsx.snap
@@ -77,6 +77,12 @@ const a = <Popconfirm
</Popconfirm>
;
+<OtherComponent
+ value={
+ new Set(veryLongConditionZzzzzzzzzzzzzzzzzveryLongConditionZzzzzzzzzzzzzzzzzveryLongConditionZzzzzzzzzzzzzzzzz)
+ }
+/>
+
```
@@ -176,6 +182,14 @@ const a = (
</Popconfirm>
);
+<OtherComponent
+ value={
+ new Set(
+ veryLongConditionZzzzzzzzzzzzzzzzzveryLongConditionZzzzzzzzzzzzzzzzzveryLongConditionZzzzzzzzzzzzzzzzz,
+ )
+ }
+/>;
+
## Unimplemented nodes/tokens
@@ -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,
```

fix(rome_js_formatter): new expression attribute (#3686)

Fix https://github.com/rome/tools/issues/3531#issuecomment-1311698292