diff --git a/crates/rome_js_formatter/src/jsx/tag/opening_element.rs b/crates/rome_js_formatter/src/jsx/tag/opening_element.rs index 5a26ddda13b..384c580b7ae 100644 --- a/crates/rome_js_formatter/src/jsx/tag/opening_element.rs +++ b/crates/rome_js_formatter/src/jsx/tag/opening_element.rs @@ -45,7 +45,6 @@ impl Format for JsxAnyOpeningElement { l_angle_token.format(), name.format(), type_arguments.format(), - line_suffix_boundary(), space(), format_close ] @@ -63,10 +62,8 @@ impl Format for JsxAnyOpeningElement { l_angle_token.format(), name.format(), type_arguments.format(), - line_suffix_boundary(), space(), attributes.format(), - (!attributes.is_empty()).then_some(line_suffix_boundary()), attribute_spacing, format_close ] @@ -80,9 +77,7 @@ impl Format for JsxAnyOpeningElement { l_angle_token.format(), name.format(), type_arguments.format(), - line_suffix_boundary(), soft_line_indent_or_space(&attributes.format()), - (!attributes.is_empty()).then_some(line_suffix_boundary()), ] )?; diff --git a/crates/rome_js_formatter/tests/specs/jsx/element.jsx b/crates/rome_js_formatter/tests/specs/jsx/element.jsx index 67406ac84d0..fe78b8cac8d 100644 --- a/crates/rome_js_formatter/tests/specs/jsx/element.jsx +++ b/crates/rome_js_formatter/tests/specs/jsx/element.jsx @@ -266,3 +266,36 @@ const breadcrumbItems = [ ), ].concat(extraBreadcrumbItems); + +function Component() { + return ( + + ); +} + +let b = ( +
+
+ aVeryLongCOntentThat +
+
+); + + +let a = ( + + + +); diff --git a/crates/rome_js_formatter/tests/specs/jsx/element.jsx.snap b/crates/rome_js_formatter/tests/specs/jsx/element.jsx.snap index 97688255b4f..527d233612e 100644 --- a/crates/rome_js_formatter/tests/specs/jsx/element.jsx.snap +++ b/crates/rome_js_formatter/tests/specs/jsx/element.jsx.snap @@ -275,6 +275,39 @@ const breadcrumbItems = [ ), ].concat(extraBreadcrumbItems); +function Component() { + return ( + + ); +} + +let b = ( +
+
+ aVeryLongCOntentThat +
+
+); + + +let a = ( + + + +); + ``` @@ -626,6 +659,42 @@ const breadcrumbItems = [ , ].concat(extraBreadcrumbItems); +function Component() { + return ( + + ); +} + +let b = ( +
+
+ aVeryLongCOntentThat +
+
+); + +let a = ( + + + +); + ## Lines exceeding width of 80 characters