Ensure JSXOpeningElement does not break with single text attr on Babylon (#1229)

This commit is contained in:
Brian Ng authored and Christopher Chedeau committed 2017-04-13 07:09:40 -07:00
1 parent 485028c32f
commit 4dfe92a76b
3 files changed
+4 -3

No files matched your search

+2 -1
View File
@@ -1296,7 +1296,8 @@ function genericPrintNoParens(path, options, print, args) {
if (
n.attributes.length === 1 &&
n.attributes[0].value &&
n.attributes[0].value.type === "Literal" &&
(n.attributes[0].value.type === "Literal" ||
n.attributes[0].value.type === "StringLiteral") &&
typeof n.attributes[0].value.value === "string"
) {
return group(
+1 -1
View File
@@ -1 +1 @@
run_spec(__dirname, null, ["typescript"]);
run_spec(__dirname, null, ["babylon", "typescript"]);
+1 -1
View File
@@ -1 +1 @@
run_spec(__dirname, null, ["typescript"]);
run_spec(__dirname, null, ["babylon", "typescript"]);