Skip to content
This repository

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.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 config
Octocat-spinner-32 gradle
Octocat-spinner-32 lib
Octocat-spinner-32 releases
Octocat-spinner-32 src
Octocat-spinner-32 .gitignore
Octocat-spinner-32 LICENSE-2.0.txt
Octocat-spinner-32 README.markdown
Octocat-spinner-32 build.gradle
Octocat-spinner-32 gradlew
Octocat-spinner-32 gradlew.bat
Octocat-spinner-32 settings.gradle
README.markdown

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: http://www.jslint.com/lint.html

More about the jslint4java ant task can be found at: http://jslint4java.googlecode.com/svn/docs/1.4/ant.html

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 {
        repositories{
            maven{
                url = 'http://kellyrob99.github.com/Jenkins-api-tour/repository'
            }
        }
        dependencies {
            classpath 'org.kar:gradle-jslint-plugin:0.2'
        }
    }

    repositories{
        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! http://www.apache.org/licenses/LICENSE-2.0

Something went wrong with that request. Please try again.