diff --git a/src/language-js/printer-estree.js b/src/language-js/printer-estree.js index 4bbb9193..5000bde1 100644 --- a/src/language-js/printer-estree.js +++ b/src/language-js/printer-estree.js @@ -4024,7 +4024,9 @@ function printArgumentsList(path, options, print) { somePrintedArgumentsWillBreak ? breakParent : "", conditionalGroup( [ - !somePrintedArgumentsWillBreak + !somePrintedArgumentsWillBreak && + !node.typeArguments && + !node.typeParameters ? simpleConcat : ifBreak(allArgsBrokenOut(), simpleConcat), shouldGroupFirst diff --git a/tests/break-calls/__snapshots__/jsfmt.spec.js.snap b/tests/break-calls/__snapshots__/jsfmt.spec.js.snap index 5eddc00e..033f231d 100644 --- a/tests/break-calls/__snapshots__/jsfmt.spec.js.snap +++ b/tests/break-calls/__snapshots__/jsfmt.spec.js.snap @@ -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( + \`api/foo.ashx/foo-details/\${myId}\`, + { cache: quux.httpCache, timeout } +); + +=====================================output===================================== +const response = something.$http.get( + \`api/foo.ashx/foo-details/\${myId}\`, + { cache: quux.httpCache, timeout } +); + +================================================================================ +`; diff --git a/tests/break-calls/type_args.js b/tests/break-calls/type_args.js new file mode 100644 index 00000000..503013f0 --- /dev/null +++ b/tests/break-calls/type_args.js @@ -0,0 +1,4 @@ +const response = something.$http.get( + `api/foo.ashx/foo-details/${myId}`, + { cache: quux.httpCache, timeout } +);