mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-20 12:15:51 +00:00
38
Gulpfile.js
38
Gulpfile.js
@@ -151,26 +151,30 @@ gulp.task('bower', ['bower-build', 'bower-build-min', 'bower-build-debug', 'bowe
|
|||||||
|
|
||||||
gulp.task('lint', function() {
|
gulp.task('lint', function() {
|
||||||
gulp.src('src/js/ripple/*.js')
|
gulp.src('src/js/ripple/*.js')
|
||||||
.pipe(jshint())
|
.pipe(jshint('./jshintrc'))
|
||||||
.pipe(map(function(file, callback) {
|
.pipe(map(function(file, callback) {
|
||||||
if (!file.jshint.success) {
|
if (file.jshint.success) {
|
||||||
console.log('\nIn', file.path);
|
return callback(null, file);
|
||||||
|
|
||||||
file.jshint.results.forEach(function(err) {
|
|
||||||
if (err && err.error) {
|
|
||||||
var col1 = err.error.line + ':' + err.error.character;
|
|
||||||
var col2 = '[' + err.error.reason + ']';
|
|
||||||
var col3 = '(' + err.error.code + ')';
|
|
||||||
|
|
||||||
while (col1.length < 8) {
|
|
||||||
col1 += ' ';
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log(' ' + [ col1, col2, col3 ].join(' '));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log('\n>' + file.path.substring(file.base.length) + '\n');
|
||||||
|
|
||||||
|
file.jshint.results.forEach(function(err) {
|
||||||
|
if (err && err.error) {
|
||||||
|
var col1 = err.error.line + ':' + err.error.character;
|
||||||
|
var col2 = err.error.reason;
|
||||||
|
var col3 = '(' + err.error.code + ')';
|
||||||
|
|
||||||
|
while (col1.length < 8) {
|
||||||
|
col1 = ' ' + col1;
|
||||||
|
}
|
||||||
|
|
||||||
|
col1 += ' |';
|
||||||
|
|
||||||
|
console.log([ col1, col2, col3 ].join(' '));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
callback(null, file);
|
callback(null, file);
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
|||||||
22
jshintrc
Normal file
22
jshintrc
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"browser": true,
|
||||||
|
"jquery": true,
|
||||||
|
"node": true,
|
||||||
|
"camelcase": false,
|
||||||
|
"eqeqeq": true,
|
||||||
|
"eqnull": true,
|
||||||
|
"latedef": true,
|
||||||
|
"newcap": true,
|
||||||
|
"quotmark": "single",
|
||||||
|
"undef": true,
|
||||||
|
"unused": true,
|
||||||
|
"curly": true,
|
||||||
|
"freeze": true,
|
||||||
|
"nonbsp": true,
|
||||||
|
"boss": true,
|
||||||
|
"laxbreak": true,
|
||||||
|
"maxparams": 4,
|
||||||
|
"maxdepth": 3,
|
||||||
|
"esnext": true,
|
||||||
|
"-W004": true
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user