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.
My JSHint version: jshint-esnext v2.7.0-3
In order to disable jshint for a workspace specify "jshint. enable" : false in the workspace settings. jshint is enabled by default.
JSHint is a program that flags suspicious usage in programs written in JavaScript. The core project consists of a library itself as well as a CLI program distributed as a Node module.
Async/Await is used to work with promises in asynchronous functions. It is basically syntactic sugar for promises. It is just a wrapper to restyle code and make promises easier to read and use. It makes asynchronous code look more like synchronous/procedural code, which is easier to understand.
The await operator is used to wait for a Promise and get its fulfillment value. It can only be used inside an async function or a JavaScript module.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With