question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[suggest] improve compatibility with more estree parsers?

See original GitHub 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.

https://github.com/eslint/eslint-scope/blob/dbddf14d5771b21b5da704213e4508c660ca1c64/lib/scope.js#L711-L718

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

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
3cpcommented, May 16, 2020

I noticed it is acknowledged that both .range and .start .end are non-standard. Same as what I read from estree spec. https://github.com/eslint/eslint/issues/8956

0reactions
3cpcommented, May 19, 2020

But I think it’s possible to totally remove the usage of .range[0].

@nzakas you probably missed my comment on reopening of the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

@typescript-eslint/typescript-estree | Yarn - Package Manager
owner typescript-eslint117.2mBSD-2-Clause5.47.1TS vulns 0 vulnerabilities. A parser that converts TypeScript source code into an ESTree compatible form.
Read more >
gruntjs - Version of TypeScript not officially supported by ...
I make the assumption that typescript is installed locally. Is it possible? How can I check the installed tool versions ( tsc and...
Read more >
eslint-plugin-import - npm
Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. Learn more.
Read more >
Working with Custom Parsers - Pluggable JavaScript Linter
The AST that custom parsers should create is based on ESTree. The AST requires some additional properties about detail information of the source...
Read more >
babel/parser
The Babel parser (previously Babylon) is a JavaScript parser used in Babel. ... It can provide up to 30% performance improvement when the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found