Improve long mapped type to across multiple line in Flow (#18779)
Co-authored-by: fisker Cheung <lionkay@gmail.com>
This commit is contained in:
1 parent
e82cf92fb4
commit
9e58cbe5e0
4 files changed
+56
-12
No files matched your search
@@ -0,0 +1,25 @@
|
||||
#### Improve long mapped type to across multiple line (#18779 by @kovsu)
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
```flow
|
||||
// Input
|
||||
type MappedType = {
|
||||
[KeyType in ValueType extends string ? VeryLongStringTypeNameHere : VeryLongNumberTypeNameHere]: KeyType
|
||||
}
|
||||
|
||||
// Prettier stable
|
||||
type MappedType = {
|
||||
[KeyType in ValueType extends string
|
||||
? VeryLongStringTypeNameHere
|
||||
: VeryLongNumberTypeNameHere]: KeyType,
|
||||
};
|
||||
|
||||
// Prettier main
|
||||
type MappedType = {
|
||||
[
|
||||
KeyType in ValueType extends string
|
||||
? VeryLongStringTypeNameHere
|
||||
: VeryLongNumberTypeNameHere
|
||||
]: KeyType,
|
||||
};
|
||||
```
|
||||
Reference in new issue
Block a user