diff --git a/.travis.yml b/.travis.yml index 9284368abf20b63885d4b7a4dc9e3bf60b6020bd..d990cf834471e84db73561f3ad4e2d63202c5068 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,7 @@ before_script: - phpenv rehash - composer install - npm install -g eslint@"<5.0.0" + - npm install -g jshint@"2.9.6" cache: directories: @@ -21,4 +22,4 @@ cache: - $HOME/.composer/cache/files script: - - vendor/bin/phing eslint phpunitfast phpcs-console php-cs-fixer-dryrun + - vendor/bin/phing eslint jshint phpunitfast phpcs-console php-cs-fixer-dryrun diff --git a/build.xml b/build.xml index d389674afa4107c3c5c3fd6f1eac30380e7b44ae..824bd2fc9fb6911496abb755b604a15bcfd88b59 100644 --- a/build.xml +++ b/build.xml @@ -67,6 +67,7 @@ <phingcall target="pdepend"/> <phingcall target="phploc"/> <phingcall target="eslint-report"/> + <phingcall target="jshint-report"/> </target> <!-- Report rule violations with PHPMD (mess detector) --> @@ -118,7 +119,15 @@ <exec command="eslint -c ${srcdir}/.eslintrc.js ${srcdir}/themes/bootstrap3/js/*.js --fix" escape="false" passthru="true" /> </target> <target name="eslint-report"> - <exec command="eslint -c ${srcdir}/.eslintrc.js ${srcdir}/themes/bootstrap3/js/*.js --format checkstyle -o ${builddir}/reports/eslint.xml" escape="false" /> + <exec command="eslint -c ${srcdir}/.eslintrc.js ${srcdir}/themes/bootstrap3/js/*.js --format checkstyle -o ${builddir}/reports/eslint-checkstyle.xml" escape="false" /> + </target> + + <!-- JSHint --> + <target name="jshint"> + <exec command="jshint --config=${srcdir}/tests/jshint.json --exclude=themes/*/js/vendor ${srcdir}/themes" checkreturn="true" passthru="true" /> + </target> + <target name="jshint-report"> + <exec command="jshint --config=${srcdir}/tests/jshint.json --exclude=themes/*/js/vendor --reporter=checkstyle ${srcdir}/themes > ${builddir}/reports/jshint-checkstyle.xml" /> </target> <!-- PHP API Documentation --> diff --git a/tests/jshint.json b/tests/jshint.json new file mode 100644 index 0000000000000000000000000000000000000000..ebcf84e417e6cbe7427098ae068640e313793c2f --- /dev/null +++ b/tests/jshint.json @@ -0,0 +1,4 @@ +{ + "latedef": true, + "laxbreak": true +}