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.

async parsing rules are broken

See original GitHub issue

Tell us about your environment

  • ESLint Version: 3.6.0
  • Node Version: 6.6
  • npm Version: whatever it comes with

What parser (default, Babel-ESLint, etc.) are you using? default

Please show your full configuration: echo 'var foo = { async: 3 };' | eslint --no-eslintrc --stdin --parser-options='ecmaVersion:2017'

What did you do? Please include the actual source code causing the issue. echo 'var foo = { async: 3 };' | eslint --no-eslintrc --stdin --parser-options='ecmaVersion:2017'

What did you expect to happen? No error.

What actually happened? Please include the actual, raw output from ESLint.


<text>
  1:18  error  Parsing error: Unexpected token :

✖ 1 problem (1 error, 0 warnings)

async is not a keyword, so it should be allowed anywhere.

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
mysticateacommented, Sep 24, 2016

I sent a PR to fix.

1reaction
platinumazurecommented, Sep 24, 2016

Acorn parses this fine and espree reproduces the issue when used directly, so I think it’s definitely an espree issue. Unfortunately, that’s all I have time for at this point, so someone else feel free to jump on it.

@mysticatea I reproduced on espree master but had no trouble when using espree’s acorn dependency (and I just cloned espree and npm install’d five minutes ago), so I’m pretty sure there’s an espree problem. (EDIT: And I just confirmed that espree pulled in acorn 4.0.3. So there’s something wrong with espree for sure)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Making parser or printer async · Issue #4459 · prettier ... - GitHub
If anyone is interested in caching parse() results in another Prettier plugin, I'm happy to extract the algorithm into an npm module.
Read more >
Building the DOM faster: speculative parsing, async, defer and ...
We'll break down how defer and async work and how you can ... Because CSS rules can override each other, the browser engine...
Read more >
a non-blocking alternative to JSON.parse to keep web UIs ...
That doesn't solve the issue of JSON.parse() being blocking. Async operations aren't meant to be used as a wrapper for synchronous ones, it's ......
Read more >
Put back the ability to parse files where async/await aren't ...
I was made aware [1] that the addition of the "cf_feature_version" field broke the backwards compatibility of the "PyRun_StringFlags()" function ...
Read more >
Problem with parsing eslint for async function - Stack Overflow
Module build failed: 19 : redirect_uri: redirectUri, 20 : }); 21 : 22 : 23 : async function getAsyncAuth() { ^ Unexpected token...
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