Expected an identifier and instead saw '>'

冷暖自知 提交于 2020-12-04 02:18:12

问题


ReactDOM.render(<App />, document.getElementById('root'));

Please let me know why VSCode [jshint] showed that issue? And please also let me know how to add some code inside .jshintrc


回答1:


JSHint does not support linting of jsx. If you want to develop react applications using jsx you should disable it or better switch to ESLint.

For Visual Studio Code there is a plugin that you can install.




回答2:


Press ⇧⌘X and then write there jshint and uninstall it.

After that write eslint and install it if not before.

And make sure your "esversion":6 is 6 for that follow below flow

For Mac VSCode : Code(Left top corner) => Prefrences => Settings => USER SETTINGS. and check at right side and write below Code

{
  "workbench.colorTheme": "Visual Studio Dark",
  "git.ignoreMissingGitWarning": true,
  "window.zoomLevel": 0,
  // you want to write below code for that
  "jshint.options": {
      "esversion":6
  },
}


来源:https://stackoverflow.com/questions/50229573/expected-an-identifier-and-instead-saw

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