Pedram marandi
Pedram marandi

Reputation: 1614

JSHint does not recognise Async/Await syntax in Visual Studio Code (VSCode)

I've been struggling with VSCode and JSHint to find out a way to get rid of this syntax highlighting. It seems like JSHint is not able to recognise Async/Await syntax.

Here you can find a screenshot of what I'm talking about.

enter image description here

My JSHint version: jshint-esnext v2.7.0-3

Upvotes: 13

Views: 7862

Answers (2)

cfrederi
cfrederi

Reputation: 66

I had the same issue and this worked for me. Try using npm uninstall -g jshint to completely unistall jshint, then npm install -g jshint to re-install the latest version. Make sure your package.json has the following information in it:

"jshintConfig": { "esversion": 8, "strict": "implied", "devel": true, "node": true, "globals": {} }

Upvotes: 5

Zinara Ozojie
Zinara Ozojie

Reputation: 341

In visual studio code, JSHint and ESLint cancels each other out. so if you want to use async functions in vscode then you have to disable Jshint and enable eslint instead.

Upvotes: 26

Related Questions