Use isBlockComment/isLineComment in canAttachComment (#9849)

This commit is contained in:
fisker Cheung authored and GitHub committed 2020-12-14 08:47:28 +08:00
1 parent 643f8906e0
commit f49e72e371
1 file changed
+3 -4
+3 -4
View File
@@ -45,6 +45,7 @@ const {
isGetterOrSetter,
isTheOnlyJSXElementInMarkdown,
isBlockComment,
isLineComment,
needsHardlineAfterDanglingComment,
rawText,
shouldPrintComma,
@@ -1271,10 +1272,8 @@ function printRegex(node) {
function canAttachComment(node) {
return (
node.type &&
node.type !== "CommentBlock" &&
node.type !== "CommentLine" &&
node.type !== "Line" &&
node.type !== "Block" &&
!isBlockComment(node) &&
!isLineComment(node) &&
node.type !== "EmptyStatement" &&
node.type !== "TemplateElement" &&
node.type !== "Import"