Thursday, May 10, 2012

Running JSLint Plugin for Grails

As a side project I am currently working on a Javascript heavy application, and I thought it was a good opportunity to see how easily Javascript  testing is brought to a Grails application (which is so good at testing all of the server side components).

I found the JS Lint Grails Plugin but was disheartened when it complained about a missing dependency (which causes me to reflect how spoilt dependency management has made me these days).

Here was my issue:

grails> install-plugin jslint
| Plugin installed.
grails> jslint
| Error Error running script jslint: : taskdef class com.googlecode.jslint4java.ant.JSLintTask cannot be found

Ridiculously easy to solve. I added the following to BuildConfig.groovy:

dependencies {
    compile 'com.googlecode.jslint4java:jslint4java-ant:2.0.2'

and voila:

grails> jslint
| Environment set to development.....
Running jslint on:web-app/js
| Error Error running script jslint: : JSLint: 57 errors in 2 files (Use --stacktrace to see the full trace)

No Reports? Make sure you are running version 0.4 or later. At the time of writing you needed to add the grailsRepo '' repository in BuildConfig.groovy to see the latest and greatest, which in this case was difference between implemented and unimplemented reporting options.


  1. A few hundred quid will buy you a great watch in it's own right without having to resort to buying a fake. replica rolex watches Certain Seiko watches or small brands such as Smiths or Precista from Timefactors have huge following and rightly watches uk/">best watches ukThey have great, durable mechanical movements and will serve for many years.

  2. Write more, that’s all I have to say.
    Literally, it seems as though you relied on the video to make your point.
    Thanks for sharinhg!
    Keep it up!