C.46 JsHintTask

This task runs JSHint, a tool that helps to detect errors and potential problems in JavaScript code. JSHint 2.5.6+ is supported, although latest JSHint is recommended.

Table C.55: Attributes

NameTypeDescriptionDefaultRequired
fileStringSingle file to perform check on.n/aNo, unless no fileset elements are present
haltOnErrorbooleanShould the build fail when there are errors in the JS code?falseNo
haltOnWarningbooleanShould the build fail when there are warnings in the JS code?falseNo
reporterStringJSHint reporter.checkstyleNo
checkstyleReportPathStringPath where the the report in Checkstyle format should be saved.n/aNo
configStringJSHint config path.n/aNo

C.46.1 Example

        <jshint
            haltonerror="false"
            haltOnWarning="false"
            reporter="jslint"
            checkstyleReportPath="${project.basedir}/build/checkstyle-jshint.xml">
            <fileset dir="${project.basedir}/public_html/www/js">
                <include name="**/**.js"/>
                <exclude name="js-cache/**"/>
            </fileset>
        </jshint>

C.46.2 Supported Nested Tags