Add Typescript@3.7 optional chaining formatting
See original GitHub issueIs your feature request related to a problem? Please describe.
The typescript@3.7
introduced optional chaining, here you can find more details.
TL;DR
it is now possible to write something like this:
const value = some?.object?.value
.
Prettier can’t handle ?.
syntax and do not dormat file.
Describe the solution you’d like Add formatter for this case.
Describe alternatives you’ve considered None
Additional context here
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Documentation - TypeScript 3.7
Optional Chaining. Optional chaining is issue #16 on our issue tracker. For context, there have been over 23,000 issues on the TypeScript issue...
Read more >Optional Chaining: The ?. Operator in TypeScript
operator, also known as the optional chaining operator. We can use optional chaining to descend into an object whose properties potentially ...
Read more >Announcing TypeScript 3.7 - Microsoft Developer Blogs
We're thrilled to announce the release of TypeScript 3.7, a release ... Well at its core, optional chaining lets us write code where...
Read more >TypeScript 3.7 arrives with optional chaining - InfoWorld
The new production release features optional chaining, an ECMAScript feature that allows developers to stop running expressions if they ...
Read more >The Beauty of the Optional Chaining Operator (?.) in TypeScript
TypeScript 3.7 gave us the optional chaining operator ( ?. ) that has the ability to shrink our, otherwise long and complex, code....
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
@cky-BryanChan I kept getting the error myself until adding prettier to my project via
yarn add --dev prettier
This is already supported. Make sure you are running the latest version of the plugin and vscode and prettier is up to date.