Add gulp task for fixing linting
parent
55c1506281
commit
c0785ce986
|
|
@ -126,21 +126,29 @@ function changeHTML(content)
|
||||||
|
|
||||||
gulp.task('clean', () => del(OUTPUT_DIR, { force: true }));
|
gulp.task('clean', () => del(OUTPUT_DIR, { force: true }));
|
||||||
|
|
||||||
|
const LINTING_FILES = [
|
||||||
|
'gulpfile.js',
|
||||||
|
'lib/**/*.js',
|
||||||
|
'lib/**/*.jsx'
|
||||||
|
];
|
||||||
|
|
||||||
gulp.task('lint', () =>
|
gulp.task('lint', () =>
|
||||||
{
|
{
|
||||||
const src =
|
return gulp.src(LINTING_FILES)
|
||||||
[
|
|
||||||
'gulpfile.js',
|
|
||||||
'lib/**/*.js',
|
|
||||||
'lib/**/*.jsx'
|
|
||||||
];
|
|
||||||
|
|
||||||
return gulp.src(src)
|
|
||||||
.pipe(plumber())
|
.pipe(plumber())
|
||||||
.pipe(eslint())
|
.pipe(eslint())
|
||||||
.pipe(eslint.format());
|
.pipe(eslint.format());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
gulp.task('lint-fix', function()
|
||||||
|
{
|
||||||
|
return gulp.src(LINTING_FILES)
|
||||||
|
.pipe(plumber())
|
||||||
|
.pipe(eslint({ fix: true }))
|
||||||
|
.pipe(eslint.format())
|
||||||
|
.pipe(gulp.dest((file) => file.base));
|
||||||
|
});
|
||||||
|
|
||||||
gulp.task('css', () =>
|
gulp.task('css', () =>
|
||||||
{
|
{
|
||||||
return gulp.src('stylus/index.styl')
|
return gulp.src('stylus/index.styl')
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue