From eee457cab6dbf2664687c9f4d03f816d6ae0119c Mon Sep 17 00:00:00 2001 From: Mimi <1119186082@qq.com> Date: Fri, 24 Apr 2020 16:05:07 +0800 Subject: [PATCH] Update gulpfile.js --- gulpfile.js | 11 ++++------- package.json | 5 +++-- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 7be68fd..1906642 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -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 => { diff --git a/package.json b/package.json index 62221e0..93faec2 100644 --- a/package.json +++ b/package.json @@ -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"