Skip to content

Commit

Permalink
Frontend(js linting): Add js linting packages (#650)
Browse files Browse the repository at this point in the history
  • Loading branch information
spyshiv authored and aka-jain committed Feb 8, 2017
1 parent 4d7c2f4 commit 3cd5791
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
16 changes: 14 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ var gulp = require('gulp'),
autoprefixer = require('gulp-autoprefixer'),
cssnano = require('gulp-cssnano'),
jshint = require('gulp-jshint'),
eslint = require('gulp-eslint'),
stylish = require('jshint-stylish'),
angularPlugin = require('eslint-plugin-angular'),
gulp_if = require('gulp-if'),
uglify = require('gulp-uglify'),
imagemin = require('gulp-imagemin'),
Expand Down Expand Up @@ -208,7 +211,6 @@ gulp.task('inject', function() {
.pipe(gulp.dest('./frontend/'));
});


// config for dev server
gulp.task('configDev', function() {
gulp.src('frontend/src/js/config.json', { base: 'frontend/src/js/' })
Expand All @@ -227,6 +229,16 @@ gulp.task('configProd', function() {
.pipe(gulp.dest('frontend/dist/js'))
});

// js linting
var lint_path = {
js: ['frontend/src/js/**/*.js', ]
}

gulp.task('lint', [], function() {
return gulp.src(lint_path.js)
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'))
});

// cleaning build process- run clean before deploy and rebuild files again
gulp.task('clean', function() {
Expand Down Expand Up @@ -349,5 +361,5 @@ gulp.task('prod', function(callback) {

// Runserver for development
gulp.task('dev:runserver', function(callback) {
runSequence('dev', 'connect', 'watch', callback);
runSequence('dev', 'lint', 'connect', 'watch', callback);
});
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,18 @@
"gulp-connect": "^5.0.0",
"gulp-cssnano": "^2.1.2",
"gulp-debug": "^3.0.0",
"gulp-eslint": "^3.0.1",
"gulp-html-minifier": "^0.1.8",
"gulp-imagemin": "^3.0.3",
"gulp-jshint": "^2.0.2",
"gulp-jshint": "^2.0.4",
"gulp-livereload": "^3.8.1",
"gulp-notify": "^2.2.0",
"gulp-prettyerror": "^1.1.1",
"gulp-rename": "^1.2.2",
"gulp-ruby-sass": "^2.1.0",
"gulp-uglify": "^2.0.0",
"jshint": "^2.9.4",
"jshint-stylish": "^2.2.1",
"merge-stream": "^1.0.0"
},
"dependencies": {
Expand Down

0 comments on commit 3cd5791

Please sign in to comment.