question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add Typescript@3.7 optional chaining formatting

See original GitHub issue

Is 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:closed
  • Created 4 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
ArcadeCityMayorcommented, Feb 23, 2020

@cky-BryanChan I kept getting the error myself until adding prettier to my project via yarn add --dev prettier

1reaction
ntottencommented, Dec 14, 2019

This is already supported. Make sure you are running the latest version of the plugin and vscode and prettier is up to date.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found