Skip to content
A Gradle custom Plugin that allows running JSLint static analysis against JavaScipt code. A blog article accompanies this source code to explain its intent and implementation.
Groovy Shell JavaScript
Find file
New pull request
Failed to load latest commit information.
src update and release version 0.2
.gitignore initial commit of jslint plugin code
gradlew.bat defer to local dependencies for testing at the integration level with…
settings.gradle update and release version 0.2


Gradle JSLint Plugin

This is a simple Plugin for Gradle which wraps an existing Ant JSLint task and makes available it's static analysis capabilities for your Gradle builds.

More information about JSLint can be found at:

More about the jslint4java ant task can be found at:

The Gradle jslint Task can be configured with the following parameters(types and defaults are shown):

    List<String> inputDirs = ['.']    
    String includes = '**/*.js'
    String excludes = ''
    String formatterType = 'plain'
    String destFilename = 'jslint'
    boolean haltOnFailure = true
    String options = ''    

The formatterTypes available are: plain, xml, html

Here's an example which uses most of the options:

 jslint {
     inputDirs = ['webapp/js']
     haltOnFailure = false
     excludes = '**/metadata/'
     options = 'rhino'
     formatterType = 'html'

You can use a Github repository to provide version 0.2 of this plugin for your build. Here's a sample configuration that works with Gradle 1.2

    apply plugin: 'java'
    group = 'temp'

    buildscript {
                url = ''
        dependencies {
            classpath 'org.kar:gradle-jslint-plugin:0.2'

        mavenCentral() //needed by the plugin to retrieve the jslint jar

    apply plugin: 'jslint'

This plugin is made available under the Apache 2.0 license, I hope you find value and have fun with it!

Something went wrong with that request. Please try again.