disable optimization from #6229 for calls with type arguments (#6791)

master
Georgii Dolzhykov 2019-11-03 14:05:08 +02:00 committed by Simon Lydell
parent 677b46df71
commit 12ba997207
3 changed files with 27 additions and 1 deletions

View File

@ -4024,7 +4024,9 @@ function printArgumentsList(path, options, print) {
somePrintedArgumentsWillBreak ? breakParent : "",
conditionalGroup(
[
!somePrintedArgumentsWillBreak
!somePrintedArgumentsWillBreak &&
!node.typeArguments &&
!node.typeParameters
? simpleConcat
: ifBreak(allArgsBrokenOut(), simpleConcat),
shouldGroupFirst

View File

@ -231,3 +231,23 @@ function MyComponent(props) {
================================================================================
`;
exports[`type_args.js 1`] = `
====================================options=====================================
parsers: ["flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
const response = something.$http.get<ThingamabobService.DetailsData>(
\`api/foo.ashx/foo-details/\${myId}\`,
{ cache: quux.httpCache, timeout }
);
=====================================output=====================================
const response = something.$http.get<ThingamabobService.DetailsData>(
\`api/foo.ashx/foo-details/\${myId}\`,
{ cache: quux.httpCache, timeout }
);
================================================================================
`;

View File

@ -0,0 +1,4 @@
const response = something.$http.get<ThingamabobService.DetailsData>(
`api/foo.ashx/foo-details/${myId}`,
{ cache: quux.httpCache, timeout }
);