Community
Participate
Working Groups
We should add a simple Javascript syntax / style checker to our tool chain. JsLint and Rhino already prooved to work. If possible IP-wise, we should include the necessary scripts in our CVS. Rhino is available in Orbit, JSLint is likely to get approval as the JSON parser with the same license did.
*** Bug 311545 has been marked as a duplicate of this bug. ***
I opened two Ipzilla CQs for this bug. The CQs are: - 4050 for JsLint - 4051 for Rhino
For starter you could use the Rockstar JSLint-Plugin for the Development-IDE-Eclipse. Just install it from: http://update.rockstarapps.com/site.xml I used it while searching for the source of bug367053. Found a whole lot of missing ";" which weren't the source of the bug.
Thanks for the tip, Stephan. I had tried the rockstar add-on before and just installed it again, but it still doesn't seem very usable to me. It doesn't generate warnings automatically, but has to be executed (and configured) manually for every single file :( Also, this project seems to be dead, isn't it?
Created attachment 208543 [details] Options for automatic JSLint check When you right-click on a js-file and configure the option for a JSLint-Check you can configure it to check for every file in the project after every save on the second Wizard-Page (Screenshot). That the project is dead may be, but for the basic JSLint-Checks it works imho pretty ok.
Thanks Stefan, but I didn't seem to become friends with this plug-in. Even if auto-build can be made to work, it produces gazillions of warnings, most of them false positives. Customizability doesn't seem to be the strong point of JSLint itself [1] and there's a fork named JSHint [2] to overcome this problem. From what I've read, JSHint seems to be the smarter alternative today. I decided to start working on a simple Eclipse integration [3]. It runs JSHint on top of Rhino. It's still very basic but already allows to adjust JSHint as needed and seems to do a good job on our JavaScript files. In the next time, I'll use this tool to eliminate the obvious warnings. Then we should come up with a set of options that constitute our JavaScript conventions. Once we have the warnings down to zero, we can add JSHint validation to our builds. [1] http://anton.kovalyov.net/2011/02/20/why-i-forked-jslint-to-jshint/ [2] http://www.jshint.com/ [3] https://github.com/ralfstx/jshint-eclipse
Hi Ralf. That looks great. I also stumbled over those "gazillions of warnings", but didn't took the time to search and investigate in alternatives. JSHint and your eclipse integration seem to be the right solution. Thanks.
The jshint-eclipse integration is now hosted at http://github.eclipsesource.com/jshint-eclipse/
(In reply to comment #8) > The jshint-eclipse integration is now hosted at http://github.eclipsesource.com/jshint-eclipse/ With JSHint Eclipse Integration in place I think we can close this bug as fixed.