The JShint can't realize ReactJS


#1

I install the package named JShint, but I found that when I am writting React grammar, it reports the err that React is not defined, ReactDOM is not defined, so how I can make it right? Thanks!


#2

I doubt problem is with React library.

It’s more likely something with:

  • ES6 syntax (or whatever flavor of JS you use).
  • JSX syntax
  • false errors on global variables (if you use these)
  • syntax error in your code
  • bug in JSHint
    etc.

But unless you share some code, there is no way to tell.


#3

@laoqiren Have you tried Nuclide? It is avaliable as atom package. It have full React support


#4

@v3ss0n I think you missed the point.

laoqiren wrote about some problem with JSHint in vague way. It’s hard to say what this problem is without more details. Yet you wrote “Have you tried Nuclide”. It’s workaround of problem, not solution.

It’s like proposing use of OSX to person who has problems with Linux :slight_smile:

On the other hand workaround is sometimes better than solving problems. I have myself switched to OSX after having problems with Linux. But as I workaround I would rather propose use ESLint instead of JSHint (because I use ESLint and I know that it works with React, if properly configured and with eslint-plugin-react)

But proposing workarounds to people can be sometimes rude… If somebody asks about tool X, why to force somebody to switch?


#5

@hex13

Nuclide is an atom package optimized for React. It is also avaliable as its own IDE/Editor build.

I am not telling him to switch other editor. Both of them are atom.

Why is that rude?


#6

Why is that rude?
Because I’ve installed Nuclide seconds ago, disabled my ESLint plugin, restarted Atom, and then I’ve written some errors in my JavaScript.

And… nothing. It seems that Nuclide has no linter feature.
Your answer would be good if Nuclide had really a JavaScript linter.

EDIT:
well. Maybe I am wrong. They write Nuclide has some feature called “code diagnostics”. But it doesn’t work on my installation (I’m not sure if JavaScript is supported).


#7

From what I’ve seen, @v3ss0n is trying to help. Sometimes when people try to help, they give suggestions that don’t pan out. That’s unfortunate, but sometimes that’s what happens when all we have to go on is a message on a message board :grinning:


#8

No,I will have a try, but I think atom is so beautiful.Thanks for your suggestion