Skip to content
Snippets Groups Projects
Commit 1f23424b authored by Demian Katz's avatar Demian Katz
Browse files

Improve Javascript style checking configuration.

- Add jshint support
- Improve name of eslint output file for use by Jenkins
parent 635b8bef
No related merge requests found
...@@ -13,6 +13,7 @@ before_script: ...@@ -13,6 +13,7 @@ before_script:
- phpenv rehash - phpenv rehash
- composer install - composer install
- npm install -g eslint@"<5.0.0" - npm install -g eslint@"<5.0.0"
- npm install -g jshint@"2.9.6"
cache: cache:
directories: directories:
...@@ -21,4 +22,4 @@ cache: ...@@ -21,4 +22,4 @@ cache:
- $HOME/.composer/cache/files - $HOME/.composer/cache/files
script: script:
- vendor/bin/phing eslint phpunitfast phpcs-console php-cs-fixer-dryrun - vendor/bin/phing eslint jshint phpunitfast phpcs-console php-cs-fixer-dryrun
...@@ -67,6 +67,7 @@ ...@@ -67,6 +67,7 @@
<phingcall target="pdepend"/> <phingcall target="pdepend"/>
<phingcall target="phploc"/> <phingcall target="phploc"/>
<phingcall target="eslint-report"/> <phingcall target="eslint-report"/>
<phingcall target="jshint-report"/>
</target> </target>
<!-- Report rule violations with PHPMD (mess detector) --> <!-- Report rule violations with PHPMD (mess detector) -->
...@@ -118,7 +119,15 @@ ...@@ -118,7 +119,15 @@
<exec command="eslint -c ${srcdir}/.eslintrc.js ${srcdir}/themes/bootstrap3/js/*.js --fix" escape="false" passthru="true" /> <exec command="eslint -c ${srcdir}/.eslintrc.js ${srcdir}/themes/bootstrap3/js/*.js --fix" escape="false" passthru="true" />
</target> </target>
<target name="eslint-report"> <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 &gt; ${builddir}/reports/jshint-checkstyle.xml" />
</target> </target>
<!-- PHP API Documentation --> <!-- PHP API Documentation -->
......
{
"latedef": true,
"laxbreak": true
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment