diff --git a/src/language-js/printer-estree.js b/src/language-js/printer-estree.js index 5e84516d7a07..fb7f10aa75af 100644 --- a/src/language-js/printer-estree.js +++ b/src/language-js/printer-estree.js @@ -1691,6 +1691,7 @@ function printPathNoParens(path, options, print, args) { n.expression.type === "JSXEmptyExpression" || n.expression.type === "TemplateLiteral" || n.expression.type === "TaggedTemplateExpression" || + n.expression.type === "DoExpression" || (isJSXNode(parent) && (n.expression.type === "ConditionalExpression" || isBinaryish(n.expression)))); diff --git a/tests/jsx-do/__snapshots__/jsfmt.spec.js.snap b/tests/jsx-do/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 000000000000..64c58c916562 --- /dev/null +++ b/tests/jsx-do/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,16 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`do.js 1`] = ` +