Skip to content

Commit a6b6ef8

Browse files
committed
fix(formatter): correct calculating layout for TSNonNullExpression in StaticMemberExpression (#15065)
1 parent 99bd995 commit a6b6ef8

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

crates/oxc_formatter/src/write/member_expression.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ fn layout<'a>(
144144
AstNodes::StaticMemberExpression(_)
145145
| AstNodes::ComputedMemberExpression(_)
146146
| AstNodes::ChainExpression(_)
147+
| AstNodes::TSNonNullExpression(_)
147148
) {
148149
first_non_static_member_ancestor = first_non_static_member_ancestor.parent();
149150
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
(<IJSONSchema>(
2+
compoundConfigurationsSchema.items
3+
)).oneOf![1].properties!.folder.enum = folderNames;
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
source: crates/oxc_formatter/tests/fixtures/mod.rs
3+
---
4+
==================== Input ====================
5+
(<IJSONSchema>(
6+
compoundConfigurationsSchema.items
7+
)).oneOf![1].properties!.folder.enum = folderNames;
8+
9+
==================== Output ====================
10+
(<IJSONSchema>(
11+
compoundConfigurationsSchema.items
12+
)).oneOf![1].properties!.folder.enum = folderNames;
13+
14+
===================== End =====================

0 commit comments

Comments
 (0)