Added linter task to gulp. Added more severe rules to jshint

This commit is contained in:
Jordi Torres 2017-03-03 18:04:59 +01:00
parent 95b49ea6da
commit 666b94bb2a
4 changed files with 45 additions and 6 deletions

18
.jshintrc Normal file
View File

@ -0,0 +1,18 @@
{
"bitwise": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"immed": true,
"indent": 4,
"latedef": true,
"newcap": true,
"noarg": true,
"nonew": true,
"undef": true,
"unused": true,
"esversion": 6,
"sub": true,
"browser": true,
"node": true
}

View File

@ -8,6 +8,9 @@ var rename = require('gulp-rename');
var uglify = require('gulp-uglify');
var gutil = require('gulp-util');
var through = require('through');
var jshint=require('gulp-jshint');
var os = require('os');
var File = gutil.File;
@ -167,6 +170,27 @@ gulp.task("scripts", ['workers','shaders'], function(){
return;
});
gulp.task('linter', function(){
gulp.src(paths.potree)
.pipe(jshint())
.pipe(jshint.reporter('default'));
gulp.src(paths.laslaz)
.pipe(jshint())
.pipe(jshint.reporter('default'));
gulp.src(workers.laslaz)
.pipe(jshint())
.pipe(jshint.reporter('default'));
gulp.src(workers.LASDecoder)
.pipe(jshint())
.pipe(jshint.reporter('default'));
gulp.src(workers.BinaryDecoder)
.pipe(jshint())
.pipe(jshint.reporter('default'));
gulp.src(workers.GreyhoundBinaryDecoder)
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
gulp.task('build', ['scripts']);
gulp.task('watch', function() {

View File

@ -1,5 +0,0 @@
{
"shadow": true,
"eqnull": true,
"laxbreak": true
}

View File

@ -8,7 +8,9 @@
"gulp-size": "*",
"gulp-concat": "*",
"gulp-uglify": "*",
"gulp-rename": "*"
"gulp-rename": "*",
"jshint": "*",
"gulp-jshint": "*"
},
"author": {},
"license": "",