Update gulpfile.js

This commit is contained in:
Mimi 2020-04-24 16:05:07 +08:00
parent f0f69a4d22
commit eee457cab6
2 changed files with 7 additions and 9 deletions

View File

@ -1,18 +1,15 @@
const fs = require('fs');
const path = require('path');
const gulp = require('gulp');
const eslint = require('gulp-eslint');
const shell = require('gulp-shell');
const yaml = require('js-yaml');
gulp.task('lint', () => gulp.src([
'./source/js/**/*.js',
'./scripts/**/*.js'
]).pipe(eslint())
.pipe(eslint.format()));
gulp.task('lint', shell.task([
'npm run eslint'
]));
gulp.task('lint:stylus', shell.task([
'npx stylint ./source/css/'
'npm run stylint'
]));
gulp.task('validate:config', cb => {

View File

@ -4,7 +4,9 @@
"description": "Elegant and powerful theme for Hexo.",
"main": "gulpfile.js",
"scripts": {
"test": "gulp"
"test": "gulp",
"eslint": "eslint source/js scripts/",
"stylint": "stylint source/css/"
},
"repository": {
"type": "git",
@ -25,7 +27,6 @@
"eslint": "6.8.0",
"eslint-config-theme-next": "1.1.4",
"gulp": "4.0.2",
"gulp-eslint": "6.0.0",
"gulp-shell": "0.8.0",
"js-yaml": "3.13.1",
"stylint": "2.0.0"