-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Use loc
version of end
, to handle parsers that don't fill name.end
.
#2026
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sounds good, but can we add test cases that would have failed without this change?
@ljharb It should be possible, but I would need to add If it is ok to add a new package to |
Sure, that seems reasonable. |
It ended up needed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@ljharb Quick question, what is the release policy for this repo? Is there a certain timeline for releases or does it just deped on a accumulation of changes? Just curious, as I am not blocked by this fix. |
There’s no policy and no set timeline; things get released when maintainers have time to do so. |
v7.12.0 is released. |
Not all parsers fill the
name.end
field in the AST structure so relying on it is less robust.Ref: babel/babel#6681
But the
range
syntax is widely supported (babel has a flag).I ran into this issue using the
typescript-eslint-parser
which does not addstart
andend
to the nodes, but has range.Here is an example to see the difference:
https://astexplorer.net/#/gist/c336be172990d7b467d1ed3dbc1882ee/d312c83cd24626d2e82ba791add48fe061b7cdc0