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
Selector Property > .key
can't match key in const {a = 1} = b;
#14799
Comments
Property > .key
can't match key in const {a = 1} = b;
Where are you seeing this? And can you provide a minimal repro case so we can see the behavior? Note the query engine is esquery, so it could be an issue there. |
This is a bug in Acorn 7 / Espree 7, nodes in a tree shouldn't have multiple parents. The bug is fixed in Acorn 8 / Espree 8 (relevant test is here). Once we switch to Espree 8.0.0, we could add a test with |
Can you try by using Espree 8 locally and let us know the result? |
Thank you, I didn't know that.
Confirmed, updating to Espree 8 fixes this. Question: ETA for switch to Espree 8.0.0? Do we need workaround in ESLint before that? |
@fisker thanks for the followup. The Espree upgrade will happen with the ESLint v8.0.0 release, which we hope we will have a preview release of in a couple weeks. We can’t upgrade Espree in ESLint v7.x line due to breaking changes. |
Tell us about your environment
What parser (default,
@babel/eslint-parser
,@typescript-eslint/parser
, etc.) are you using?The default parser.
The issue template doesn't fit, so I removed these sections.
I was making an eslint plugin, for this code
I should be able to use
Property > .key
to select the key, but ESLint won't match.I think this happens because we use the same reference for
key
andvalue.left
, so they both have theAssignmentPattern
as parent. For this reason, I don't think this is an issue byespree
oracorn
.This happens to assignment too.
The text was updated successfully, but these errors were encountered: