mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-06-14 22:20:52 -04:00
Implement jshint and watch task.
This commit is contained in:
parent
89b3238385
commit
1dcb19ec3b
3 changed files with 52 additions and 0 deletions
22
gulp/tasks/jshint.js
Normal file
22
gulp/tasks/jshint.js
Normal file
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
|
||||
* http://paperjs.org/
|
||||
*
|
||||
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
|
||||
* http://scratchdisk.com/ & http://jonathanpuckey.com/
|
||||
*
|
||||
* Distributed under the MIT license. See LICENSE file for details.
|
||||
*
|
||||
* All rights reserved.
|
||||
*/
|
||||
|
||||
var gulp = require('gulp'),
|
||||
jshint = require('gulp-jshint'),
|
||||
cache = require('gulp-cached');
|
||||
|
||||
gulp.task('jshint', function () {
|
||||
return gulp.src('src/**/*.js')
|
||||
.pipe(cache('jshint', { optimizeMemory: true }))
|
||||
.pipe(jshint())
|
||||
.pipe(jshint.reporter('jshint-summary'));
|
||||
});
|
27
gulp/tasks/watch.js
Normal file
27
gulp/tasks/watch.js
Normal file
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
|
||||
* http://paperjs.org/
|
||||
*
|
||||
* Copyright (c) 2011 - 2016, Juerg Lehni & Jonathan Puckey
|
||||
* http://scratchdisk.com/ & http://jonathanpuckey.com/
|
||||
*
|
||||
* Distributed under the MIT license. See LICENSE file for details.
|
||||
*
|
||||
* All rights reserved.
|
||||
*/
|
||||
|
||||
var gulp = require('gulp'),
|
||||
path = require('path'),
|
||||
gutil = require('gulp-util');
|
||||
|
||||
|
||||
gulp.task('watch', function () {
|
||||
gulp.watch('src/**/*.js', ['jshint'])
|
||||
.on('change', function(event) {
|
||||
gutil.log(
|
||||
gutil.colors.green('File ' + event.type + ': ') +
|
||||
gutil.colors.magenta(path.basename(event.path))
|
||||
);
|
||||
});
|
||||
});
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue