Parsing error: Unexpected token =>
See original GitHub issuecode:
const task = (fn) => async () => {
const start = new Date();
console.log(`[${format(start)}] Starting '${fn.name}'...`);
await fn();
const end = new Date();
const time = end.getTime() - start.getTime();
console.log(`[${format(end)}] Finished '${fn.name}' after ${time}ms`);
};
error:
error Parsing error: Unexpected token =>
config:
airbnb/base (eslint-config-airbnb@2.1.1, eslint@1.10.3
)
Issue Analytics
- State:
- Created 8 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
ESLint Parsing error: Unexpected token - Stack Overflow
Unexpected token errors in ESLint parsing occur due to incompatibility between your development environment and ESLint's current parsing ...
Read more >3 Easy Steps to Fix the Parsing Error Unexpected Token issue
The Parsing error unexpected token usually occurs when there is an incompatibility between the parser option and the code.
Read more >ESLint: "Parsing error: Unexpected token" in Visual Studio Code
Unexpected token errors are caused by incompatibilities in your parser options and the code you're writing. In this case, I'm using a number...
Read more >[ESLint] Parsing error: unexpected token - DEV Community
What is this article about? This is a solution when I saw these errors. Warning: React version not specified in eslint-plugin-react settings. ...
Read more >Parsing Error: Unexpected Token ; - ServiceNow Community
I am trying to create a business rule that requires a field in a child table/record to be mandatory when certain fields in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@dwang68 I have
'ecmaVersion': 8
and it works. So first I would suggest to set8
and see.async
/await
are part of es2017 spec (i.e.ecmaVersion: 8
). es2016 only added one syntax change to the language -**
operator.