565 jsx parentheses fix (#580)
* Add JSXElement in ShouldPrintSameLine helper function.
* Add tests 🚀.
master
parent
86d1264097
commit
6efad59300
|
@ -2624,6 +2624,7 @@ function shouldPrintSameLine(node) {
|
||||||
type === "CallExpression" ||
|
type === "CallExpression" ||
|
||||||
type === "FunctionExpression" ||
|
type === "FunctionExpression" ||
|
||||||
type === "Identifier" ||
|
type === "Identifier" ||
|
||||||
|
type === "JSXElement" ||
|
||||||
type === "Literal" ||
|
type === "Literal" ||
|
||||||
type === "MemberExpression" ||
|
type === "MemberExpression" ||
|
||||||
type === "NewExpression" ||
|
type === "NewExpression" ||
|
||||||
|
|
|
@ -193,3 +193,34 @@ exports[`test quotes.js 1`] = `
|
||||||
<div id={\"\'\\\""<>&quot;\"} />;
|
<div id={\"\'\\\""<>&quot;\"} />;
|
||||||
"
|
"
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
exports[`test object-property.js 1`] = `
|
||||||
|
"const tabs = [
|
||||||
|
{
|
||||||
|
title: \"General Info\",
|
||||||
|
content: (
|
||||||
|
<GeneralForm
|
||||||
|
long-attribute=\"i-need-long-value-here\"
|
||||||
|
onSave={ onSave }
|
||||||
|
onCancel={ onCancel }
|
||||||
|
countries={ countries }
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
];
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
const tabs = [
|
||||||
|
{
|
||||||
|
title: \"General Info\",
|
||||||
|
content: (
|
||||||
|
<GeneralForm
|
||||||
|
long-attribute=\"i-need-long-value-here\"
|
||||||
|
onSave={onSave}
|
||||||
|
onCancel={onCancel}
|
||||||
|
countries={countries}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
];
|
||||||
|
"
|
||||||
|
`;
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
const tabs = [
|
||||||
|
{
|
||||||
|
title: "General Info",
|
||||||
|
content: (
|
||||||
|
<GeneralForm
|
||||||
|
long-attribute="i-need-long-value-here"
|
||||||
|
onSave={ onSave }
|
||||||
|
onCancel={ onCancel }
|
||||||
|
countries={ countries }
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
];
|
Loading…
Reference in New Issue