mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-23 07:07:09 -05:00
Fix formatting scanner on JSX text that looks like trivia (#39718)
* Fix formatting scanner on JSX text that looks like trivia * Combine if statements Co-authored-by: Andrew Branch <andrew@wheream.io>
This commit is contained in:
@@ -483,7 +483,8 @@ namespace ts {
|
||||
return node.pos;
|
||||
}
|
||||
|
||||
if (isJSDocNode(node)) {
|
||||
if (isJSDocNode(node) || node.kind === SyntaxKind.JsxText) {
|
||||
// JsxText cannot actually contain comments, even though the scanner will think it sees comments
|
||||
return skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos, /*stopAfterLineBreak*/ false, /*stopAtComments*/ true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user