jshint-eclipse
jshint-eclipse copied to clipboard
Run jshint on all projects by default
For some odd reason, I've not been able to get the jshint-elipse plugin working. I've tried with multiple eclipse versions both 32 and 64 bit (helios, indigo and juno) (32 + 64 bit tested on OSX) and am not sure what is going on.
How I've tested:
1.After installing the plugin and restarting Eclipse, I then add the following options to jshint:
strict: true
(no quotes)
2.After which, I close all open editors and open a js file. I do bad things, like create functions without "use strict". I've also tried adding
white: true
Yielding no warnings whatsoever.
Am I doing something wrong or have I missed a step?
--Thanks in advance
You have to explicitly enable JSHint for your project. You can do so by adding a file pattern on the "JSHint" page in your project's preferences.
Ralf,
Thanks for the information, I must have missed that in the documentation... forgive me for not RTFM. It's working now
Thanks again, Samuel M
On Sun, Oct 28, 2012 at 3:48 AM, Ralf Sternberg [email protected]:
You have to explicitly enable JSHint for your project. You can do so by adding a file pattern on the "JSHint" page in your project's preferences.
— Reply to this email directly or view it on GitHubhttps://github.com/eclipsesource/jshint-eclipse/issues/29#issuecomment-9844550.
Maybe it's not obvious. I wanted to avoid checking all files by default for performance reasons. JSHint is written in JavaScript, and running large scripts is not exactly fast. OTOH, checking all *.js files by default (maybe excluding .min.js files) would not affect non-JS projects, and for JS-ony workspaces, checking all projects is probably useful...
@ralfstx I would like to encourage this idea. It would be extremely useful, JS developers with JSHINT want to validate every *.js file in any project except for vendor specifics or minified ones.
@ralfstx I agree that it would be better for the plug-in to "just work", with a *.js pattern, rather than requiring configuration initially. If both Sam and I missed that step the first time we installed the plug-in, I'm sure many others did as well.
Also, given that the front page of the GitHub project says:
It automatically validates *.js files
if you don't make that change then a verbiage change would seem warranted.
Changed the title to reflect the actual suggestion. Not sure if it is possible at all because at some point the builder has to be added to the project.
Thank you for this issue. I just ran into it today. It would be helpful if this was more clearly stated on the http://github.eclipsesource.com/jshint-eclipse/about.html
I have the same problem but does not get it to run even if I done the above. At least I think I have don it. Any other things that one need to do?
I had to build my project to get JSHint to detect the errors I had. Can I get it to run automatically as the java compiler does, if dp how?