Pyae Phyoe Shein
Pyae Phyoe Shein

Reputation: 13837

Expected an identifier and instead saw '>'

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

enter image description here

Upvotes: 6

Views: 9835

Answers (3)

Sanushi Salgado
Sanushi Salgado

Reputation: 1456

If you have already installed jshint in VS code & gives errors in your react app, then you can disable the jshint extension & it will fix all the issues.

Upvotes: -1

SWAPDROiD
SWAPDROiD

Reputation: 367

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
  },
}

Upvotes: 3

trixn
trixn

Reputation: 16354

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.

Upvotes: 9

Related Questions