This website requires JavaScript.
Explore
Help
Sign In
vitalif
/
prettier
Watch
1
Star
0
Fork
You've already forked prettier
0
Code
Issues
Pull Requests
Releases
Wiki
Activity
82257bc091
prettier
/
tests
/
typescript_optional_type
/
complex.ts
3 lines
98 B
TypeScript
Raw
Normal View
History
Unescape
Escape
fix(typescript): preserve necessary parens for TSOptionalType (#5056)
2018-09-06 04:04:37 +03:00
type
T
=
[
(
"a"
|
"b"
)
?
]
;
Get rid of TSParenthesizedType nodes before proceeding with formatting (#6605) * get rid of TSParenthesizedType nodes before proceeding with formatting * fix parens for TSIndexedAccessType, TSFunctionType, TSConditionalType fixes #6603 * workaround edge cases with one-item unions and intersections * fix parens for TSInferType * fix parens for rest elements in tuple types * refactoring * fix function types in conditional types * move tests for rest and optional tuple elements * fix comment issues * tests for unions and intersections * add parens around multiline unions in tuple * move the parens check for TS nodes closer to the one for Flow nodes * update CHANGELOG.unreleased.md * remove dead code * fix parens for TSConstructorType * better wording in CHANGELOG.unreleased.md
2019-10-14 15:00:21 +03:00
type
TupleWithOptional
=
[
number
,
(
1
extends
2
?
string
[
]
:
number
[
]
)
?
]
;