-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: nodeWillIndentChild judge for BinaryExpression with JsxElement c…
…hild (#44695)
- Loading branch information
Showing
2 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
tests/cases/fourslash/formatSelectionJsxWithBinaryExpression.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/// <reference path="fourslash.ts" /> | ||
|
||
//@Filename: file.tsx | ||
//// function TestWidget() { | ||
//// const test = true; | ||
//// return ( | ||
//// <div> | ||
//// {test && | ||
//// <div> | ||
//// /*1*/ <div>some text</div>/*2*/ | ||
//// <div>some text</div> | ||
//// <div>some text</div> | ||
//// </div> | ||
//// } | ||
//// <div>some text</div> | ||
//// </div> | ||
//// ); | ||
//// } | ||
|
||
format.selection("1", "2"); | ||
verify.currentFileContentIs( | ||
`function TestWidget() { | ||
const test = true; | ||
return ( | ||
<div> | ||
{test && | ||
<div> | ||
<div>some text</div> | ||
<div>some text</div> | ||
<div>some text</div> | ||
</div> | ||
} | ||
<div>some text</div> | ||
</div> | ||
); | ||
}`) |