Inline class expressions for bracket-less arrow functions (#1023)

I could go either way but it doesn't seem a big deal to inline them. I don't expect it to be very common anyway

Fixes #990
master
Christopher Chedeau 2017-03-17 11:01:17 -07:00 committed by James Long
parent 328a5be284
commit dc52a71923
3 changed files with 32 additions and 3 deletions

View File

@ -338,7 +338,8 @@ function genericPrintNoParens(path, options, print) {
n.body.type === "JSXElement" ||
n.body.type === "BlockStatement" ||
n.body.type === "TaggedTemplateExpression" ||
n.body.type === "TemplateElement"
n.body.type === "TemplateElement" ||
n.body.type === "ClassExpression"
) {
return group(collapsed);
}

View File

@ -140,7 +140,17 @@ function render() {
/>
</View>
);
}~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
}
jest.mock(
'../SearchSource',
() => class {
findMatchingTests(pattern) {
return {paths: []};
}
},
);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Seq(typeDef.interface.groups).forEach(group =>
Seq(group.members).forEach((member, memberName) =>
markdownDoc(member.doc, {
@ -209,6 +219,15 @@ function render() {
</View>
);
}
jest.mock(
\\"../SearchSource\\",
() => class {
findMatchingTests(pattern) {
return { paths: [] };
}
}
);
"
`;

View File

@ -64,4 +64,13 @@ function render() {
/>
</View>
);
}
}
jest.mock(
'../SearchSource',
() => class {
findMatchingTests(pattern) {
return {paths: []};
}
},
);