mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-29 16:29:19 -05:00
fix: nodeWillIndentChild judge for BinaryExpression with JsxElement child (#44695)
This commit is contained in:
@@ -606,6 +606,11 @@ namespace ts.formatting {
|
||||
if (!settings.indentMultiLineObjectLiteralBeginningOnBlankLine && sourceFile && childKind === SyntaxKind.ObjectLiteralExpression) { // TODO: GH#18217
|
||||
return rangeIsOnOneLine(sourceFile, child!);
|
||||
}
|
||||
if (parent.kind === SyntaxKind.BinaryExpression && sourceFile && child && childKind === SyntaxKind.JsxElement) {
|
||||
const parentStartLine = sourceFile.getLineAndCharacterOfPosition(skipTrivia(sourceFile.text, parent.pos)).line;
|
||||
const childStartLine = sourceFile.getLineAndCharacterOfPosition(skipTrivia(sourceFile.text, child.pos)).line;
|
||||
return parentStartLine !== childStartLine;
|
||||
}
|
||||
if (parent.kind !== SyntaxKind.BinaryExpression) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user