Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[JENKINS-34438] Activate JSHint during the build process
  • Loading branch information
recena committed Apr 25, 2016
1 parent a4b070b commit f523a0e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
12 changes: 12 additions & 0 deletions war/gulpfile.js
@@ -1,3 +1,6 @@
var gulp = require('gulp');
var jshint = require('gulp-jshint');

//
// See https://github.com/tfennelly/jenkins-js-builder
//
Expand Down Expand Up @@ -44,3 +47,12 @@ builder.bundle('src/main/js/add-item.js')
.withExternalModuleMapping('jquery-detached', 'core-assets/jquery-detached:jquery2')
.less('src/main/js/add-item.less')
.inDir('src/main/webapp/jsbundles');

//
// JSHint, a JavaScript Code Quality Tool
//
gulp.task('lint', function() {
return gulp.src('./src/main/js/**/*.js')
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
4 changes: 3 additions & 1 deletion war/package.json
Expand Up @@ -9,7 +9,9 @@
"hbsfy": "^2.4.1",
"jenkins-handlebars-rt": "^1.0.1",
"jenkins-js-builder": "0.0.40",
"jenkins-js-test": "^1.0.0"
"jenkins-js-test": "^1.0.0",
"jshint": "^2.9.2",
"gulp-jshint": "^2.0.0"
},
"dependencies": {
"bootstrap-detached": "^3.3.5-v1",
Expand Down
4 changes: 2 additions & 2 deletions war/pom.xml
Expand Up @@ -696,7 +696,7 @@ THE SOFTWARE.
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>0.0.23</version>
<version>1.0</version>

<executions>

Expand Down Expand Up @@ -733,7 +733,7 @@ THE SOFTWARE.
<goal>gulp</goal>
</goals>
<configuration>
<arguments>bundle</arguments>
<arguments>bundle lint</arguments>
</configuration>
</execution>

Expand Down

0 comments on commit f523a0e

Please sign in to comment.