Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for the experimental syntax 'optionalChaining' #369

Closed
LoicMahieu opened this issue Dec 14, 2019 · 0 comments · Fixed by #370
Closed

Support for the experimental syntax 'optionalChaining' #369

LoicMahieu opened this issue Dec 14, 2019 · 0 comments · Fixed by #370
Labels
kind: feature New feature or request

Comments

@LoicMahieu
Copy link
Contributor

LoicMahieu commented Dec 14, 2019

Current Behavior

Could not use optional chaining with [email protected] and [email protected]:

(babel plugin) SyntaxError: /some-path/Foo.ts: Support for the experimental syntax 'optionalChaining' isn't currently enabled (1:19):
> 1 | console.log(foo.bar?.foo)

Desired Behavior

Optional chaining is enabled

Suggested Solution

// Adds syntax support for optional chaining (.?)
{ name: '@babel/plugin-proposal-optional-chaining' },
// Adds syntax support for default value using ?? operator
{ name: '@babel/plugin-proposal-nullish-coalescing-operator' },
LoicMahieu added a commit to LoicMahieu/tsdx that referenced this issue Dec 14, 2019
LoicMahieu added a commit to LoicMahieu/tsdx that referenced this issue Dec 16, 2019
swyxio pushed a commit that referenced this issue Dec 16, 2019
* Add optional chaining and nullish coalescing operators support

Closes #369

* Update `[email protected]` to support TypeScript 3.7

Release note: https://prettier.io/blog/2019/11/09/1.19.0.html
@agilgur5 agilgur5 added the kind: feature New feature or request label Mar 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants