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

偶尔善良 提交于 2019-12-23 06:58:46

问题


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


回答1:


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": {} }




回答2:


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.



来源:https://stackoverflow.com/questions/46783809/jshint-does-not-recognise-async-await-syntax-in-visual-studio-code-vscode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!