-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
no-unused-expressions makes an error for optional chaining of method calls: foo?.bar(); #12822
no-unused-expressions makes an error for optional chaining of method calls: foo?.bar(); #12822
Comments
We're currently blocked by estree/estree#204. Once that lands, all of the core rules will be updated to handle this syntax. Thanks for your patience! |
Slightly adjacent, what is the reason for the "no-unused-expressions" rule being matched for statements that cannot be parsed? |
My guess is that the issue author is using a custom parser that can parse this. When using the default parser, this would currently be a parser error. |
Yes I am using "babel/no-unused-expressions" to get around that other issue. |
Has this issue been addressed? I am still seeing the eslint error for an unused expression when using optional chaining
|
In the meantime, you can ignore with |
As mentioned above, we're still blocked by ESTree deciding on the AST spec. |
estree/estree#204 is merged! :) |
Any update on this? We can remove blocked label at least. |
The core
Edit: we changed how the core |
#13416 and babel/babel#11815 seems to be released. I had no issue without babel-eslint-plugin. Can we close this issue? |
Yes, I think we can close this issue. We also changed the rule to not warn on unknown expressions when used with third-party parsers. I can confirm now that the core |
Reviving #11045 since optional chaining arrived Stage4!
I am unable to write a heads-up to the Issue itself.
This conversation has been locked and limited to collaborators.
The text was updated successfully, but these errors were encountered: