Reputation: 17541
I work on a project where we use optional chaining operator (aka Elvis operator):
const baz = new obj?.foo?.bar?.baz()
Is it a way to make WebStorm understand it?
P.S. It's a part of stage-1
proposals: https://github.com/tc39/proposal-optional-chaining
Upvotes: 8
Views: 2064
Reputation: 3257
Finally typescript version 3.7
supports optional chaining.
For webstorm to support it you need to update it to the latest version. It would work as expected.
Typescript - https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html
Webstorm Release notes - https://blog.jetbrains.com/webstorm/2019/10/webstorm-2019-2-4/
Upvotes: 3
Reputation: 49
Here is an issue about this https://youtrack.jetbrains.com/issue/WEB-27592. Seems like it's resolved so we can wait for the feature in next build.
Upvotes: 1