Generic type breaks line in none expected way
See original GitHub issuePrettier 1.15.2 Playground link
--parser typescript
--print-width 100
--single-quote
--use-tabs
Input:
fetchPaymentsResult$ = (this.actions$.ofType(FETCH_PAYMENT_OVERVIEW) as Observable<Action>).switchMap(() =>
this.paymentsService
.fetch()
);
Output:
fetchPaymentsResult$ = (this.actions$.ofType(FETCH_PAYMENT_OVERVIEW) as Observable<
Action
>).switchMap(() => this.paymentsService.fetch());
Expected behavior:
This Observable<Action>
should not be broken apart.
An acceptable output would be
fetchPaymentsResult$ = (this.actions$.ofType(FETCH_PAYMENT_OVERVIEW) as
Observable<Action>).switchMap(() => this.paymentsService.fetch());
Issue Analytics
- State:
- Created 5 years ago
- Reactions:14
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Generic method is not type-sensitive - Stack Overflow
I am learning the Generics and tried to alter one of the examples. I expected the code will not compile even with the...
Read more >Generic Types - Learning the Java Language
A generic type is a generic class or interface that is parameterized over types. The following Box class will be modified to demonstrate...
Read more >io — Core tools for working with streams — Python 3.11.1 ...
The newline argument works like that of TextIOWrapper , except that when writing output to the stream, if newline is None , newlines...
Read more >4.1. Generic Types - Java in a Nutshell, 5th Edition [Book]
A generic type is defined using one or more type variables and has one or more ... The add( ) method is redefined...
Read more >C++ Core Guidelines - GitHub Pages
We do not expect you to memorize all the rules before trying to write code. One way of thinking about these guidelines is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Probably, as long as it includes tests and doesn’t add an option 😃
Not sure. #5399 happens when chaining, this one is when assigning a type.