简体   繁体   中英

Is there a way to enable support of optional chaining operators in WebStorm

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?

PS It's a part of stage-1 proposals: https://github.com/tc39/proposal-optional-chaining

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/

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM