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
[suggest] improve compatibility with more estree parsers? #58
Comments
I'm not sure we can go that way, as Related issue(s): RFC25, eslint/eslint#12096, eslint/eslint#12955 |
Oh, thx! I did not know it got that much complications. |
I noticed it is acknowledged that both |
I think there is an opportunity to improve. It's not about The reason of using ranges to check, is that the I could not get my head around the code base to come up a solution. But I think it's possible to totally remove the usage of |
If you're looking for a completely estree-compliant version, isn't that what |
I came here to find an up-to-date version of escope 😄 |
As mentioned previously, the start and stop properties are not part of ESTree. They only appear in Espree because we are built on Acorn, which adds these nonstandard properties. Removing them incurs a performance penalty so we leave them in place. However, we don’t rely on those properties being present and always use range internally. Because we don’t want to encourage relying on nonstandard properties, we won’t be updating this package to use start and end. Thanks! |
@nzakas you probably missed my comment on reopening of the issue. |
I am trying to use eslint-scope with meriyah which uses different data structure for ranges.
It doesn't have
.range: [start, end]
, but has direct.start
and.end
.eslint-scope/lib/scope.js
Lines 711 to 718 in dbddf14
If I update the above code from
.range[0]
to.start
, everything works fine with meriyah.Do you consider to improve compatibility with other estree parsers? To check both
.range[0]
and.start
? Thanks!FYI, estree spec seems didn't define the shape of ranges, it only defined position. https://github.com/estree/estree/blob/14df8a024956ea289bd55b9c2226a1d5b8a473ee/es5.md#node-objects
The text was updated successfully, but these errors were encountered: