diff --git a/gulpfile.js b/gulpfile.js index 5cd73f77e..885ffe042 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -10,6 +10,12 @@ var rename = require('gulp-rename'); var istanbul = require('gulp-istanbul'); var bump = require('gulp-bump'); var tag_version = require('gulp-tag-version'); +var jshint = require('gulp-jshint'); +var stylish = require('jshint-stylish'); + +var paths = { + scripts: ['./src/*.js'] +}; gulp.task('jison2', function() { return gulp.src('./src/*.jison') @@ -151,4 +157,11 @@ function inc(importance) { gulp.task('patch', function() { return inc('patch'); }) gulp.task('feature', function() { return inc('minor'); }) -gulp.task('release', function() { return inc('major'); }) \ No newline at end of file +gulp.task('release', function() { return inc('major'); }) + +// Using gulp-jshint and jshint-stylish +gulp.task('lint', function() { + return gulp.src(paths.scripts) + .pipe(jshint()) + .pipe(jshint.reporter(stylish)); +}); diff --git a/package.json b/package.json index 36355657f..d88628c99 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "gulp-istanbul": "^0.4.0", "gulp-jasmine": "~1.0.1", "gulp-jison": "~1.0.0", + "gulp-jshint": "^1.9.0", "gulp-less": "^1.3.6", "gulp-rename": "~1.2.0", "gulp-shell": "^0.2.10", @@ -37,6 +38,7 @@ "he": "^0.5.0", "jasmine": "~2.0.1", "jison": "~0.4.15", + "jshint-stylish": "^1.0.0", "karma": "~0.12.20", "karma-chrome-launcher": "~0.1.5", "karma-jasmine": "~0.2.1",