Skip to content

Commit b7d655c

Browse files
committed
fix(formatter): non-nested static member expressions will never break
1 parent 515febe commit b7d655c

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

crates/oxc_formatter/src/write/member_expression.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ fn layout<'a>(
127127
if no_break || is_member_chain {
128128
return StaticMemberLayout::NoBreak;
129129
}
130-
true
130+
131+
false
131132
}
132133
AstNodes::StaticMemberExpression(_) | AstNodes::ComputedMemberExpression(_) => true,
133134
_ => false,
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
options = BracketMatchingControllerLONGLONGLONG._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
source: crates/oxc_formatter/tests/fixtures/mod.rs
3+
---
4+
==================== Input ====================
5+
options = BracketMatchingControllerLONGLONGLONG._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER;
6+
==================== Output ====================
7+
options =
8+
BracketMatchingControllerLONGLONGLONG._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER;
9+
10+
===================== End =====================

0 commit comments

Comments
 (0)