Skip to content

Commit 6c1c925

Browse files
committed
gulp fixes
`jslint` works now, added `watch` for continuous `jslint`+`build` on file changes.
1 parent 9efd067 commit 6c1c925

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

config.jshintrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"node": true,
3+
"unused": true,
4+
"predef": [ "require", "module" ]
5+
}

gulpfile.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ var gulp = require('gulp'),
1313
browserify = require('browserify'),
1414
streamify = require('gulp-streamify'),
1515
source = require('vinyl-source-stream'),
16-
merge = require('merge-stream');
16+
merge = require('merge-stream'),
17+
watch = require('gulp-watch');
1718

1819
var srcDir = './src/';
1920
var outDir = './';
@@ -31,6 +32,7 @@ var header = "/*!\n\
3132
gulp.task('build', buildTask);
3233
gulp.task('bump', bumpTask);
3334
gulp.task('jshint', jshintTask);
35+
gulp.task('watch', watchTask);
3436

3537
function buildTask() {
3638
var nonBundled = browserify('./src/chart.annotation.js')
@@ -86,3 +88,8 @@ function jshintTask() {
8688
.pipe(jshint.reporter('jshint-stylish'))
8789
.pipe(jshint.reporter('fail'));
8890
}
91+
92+
function watchTask() {
93+
buildTask();
94+
gulp.watch('src/*.js', ['jshint', 'build']);
95+
}

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@
1818
"gulp-streamify": "^1.0.2",
1919
"gulp-uglify": "^1.5.3",
2020
"gulp-util": "^3.0.7",
21+
"gulp-watch": "^4.3.10",
2122
"inquirer": "^1.0.2",
2223
"jshint": "^2.9.2",
24+
"jshint-stylish": "^2.2.1",
2325
"merge-stream": "^1.0.0",
2426
"semver": "^5.1.0",
2527
"vinyl-source-stream": "^1.1.0"

0 commit comments

Comments
 (0)