Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Nov 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/language-js/printer-estree.js
Expand Up @@ -4024,7 +4024,9 @@ function printArgumentsList(path, options, print) {
somePrintedArgumentsWillBreak ? breakParent : "",
conditionalGroup(
[
!somePrintedArgumentsWillBreak
!somePrintedArgumentsWillBreak &&
!node.typeArguments &&
!node.typeParameters
lydell marked this conversation as resolved.
Show resolved Hide resolved
? simpleConcat
: ifBreak(allArgsBrokenOut(), simpleConcat),
shouldGroupFirst
Expand Down
20 changes: 20 additions & 0 deletions tests/break-calls/__snapshots__/jsfmt.spec.js.snap
Expand Up @@ -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 }
);

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