-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
46 lines (38 loc) · 1.04 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
const gulp = require('gulp');
const eslint = require('gulp-eslint');
const jsdoc = require('gulp-jsdoc3');
const excludeGitignore = require('gulp-exclude-gitignore');
const open = require('gulp-open');
/**
* Check the source code quality based in the rules defined
* in .eslitrc file
*/
gulp.task('lint', () => {
return gulp.src(['**/*.js', '!node_modules/**'])
.pipe(excludeGitignore())
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});
/**
* Generate project code documentation using JSDoc3
*/
gulp.task('generate-doc', cb => {
var config = require('./.jsdoc.json');
gulp.src([
'README.md',
'./lib/**/*.js'
], {
read: false
})
.pipe(jsdoc(config, cb));
});
/**
* Open JSDoc generated documentation
*/
gulp.task('open-doc', () => {
return gulp.src('./docs/index.html')
.pipe(open());
});
gulp.task('doc', gulp.series('generate-doc', 'open-doc'));
gulp.task('default', gulp.series('lint'));