forked from jDevxyz/synchronous-ify
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
35 lines (31 loc) · 982 Bytes
/
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
'use strict'
const gulp = require('gulp')
const jsdoc = require('jsdoc-to-markdown')
const standard = require('standard')
const eslint = require('gulp-eslint')
const fs = require('fs')
const del = require('del')
const { exec } = require('child_process')
const docsOptions = {
files: './src/**/*.js',
'example-lang': 'js',
noCache: true
}
gulp.task('lint', (done) => {
gulp.src('./src/**/*.js')
.pipe(eslint({
configFile: '.eslintrc.json'
}))
.pipe(eslint.format())
return standard.lintFiles([], { cwd: './src', fix: true, plugins: ['eslint-plugin-standard', 'eslint-plugin-node', 'eslint-plugin-promise', 'eslint-plugin-import', 'eslint-plugin-markdown'] }, (err, args) => {
if (err) done(err)
else done()
})
})
gulp.task('docs', gulp.series(gulp.parallel('lint'), (done) => {
del.sync(['./docs/*.md', './docs/**/*.md'])
jsdoc.render(docsOptions).then(data => {
fs.writeFileSync('./docs/README.md', data)
return done()
})
}))