From 1ac401dbfa766f9ed84285e1ea0b87cca824651a Mon Sep 17 00:00:00 2001 From: typer Date: Mon, 2 Nov 2020 17:53:53 -0800 Subject: [PATCH] moved eslint config definition above use --- gulpfile.js | 62 ++++++++++++++++++++++++++--------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index a8c20d9bb..bc153a35c 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -20,37 +20,6 @@ const gulpSrc = [ "./src/js/script.js", ]; -task("cat", function () { - return src(gulpSrc) - .pipe(concat("monkeytype.js")) - .pipe(eslint(eslintConfig)) - .pipe(eslint.format()) - .pipe(eslint.failAfterError()) - .pipe(dest("./dist/js")); -}); - -task("sass", function () { - return src("./src/sass/*.scss") - .pipe(sass({ outputStyle: "compressed" }).on("error", sass.logError)) - .pipe(dest("dist/css")); -}); - -task("static", function () { - return src("./public/**/*").pipe(dest("./dist/")); -}); - -task("clean", function () { - return src("./dist/", { allowEmpty: true }).pipe(vinylPaths(del)); -}); - -task("compile", series("static", "sass", "cat")); - -task("watch", function () { - watch(["./public/**/*", "./src/**/*"], series("compile")); -}); - -task("build", series("clean", "compile")); - let eslintConfig = { parser: "babel-eslint", extends: "eslint:recommended", @@ -116,3 +85,34 @@ let eslintConfig = { "valid-typeof": "error", }, }; + +task("cat", function () { + return src(gulpSrc) + .pipe(concat("monkeytype.js")) + .pipe(eslint(eslintConfig)) + .pipe(eslint.format()) + .pipe(eslint.failAfterError()) + .pipe(dest("./dist/js")); +}); + +task("sass", function () { + return src("./src/sass/*.scss") + .pipe(sass({ outputStyle: "compressed" }).on("error", sass.logError)) + .pipe(dest("dist/css")); +}); + +task("static", function () { + return src("./public/**/*").pipe(dest("./dist/")); +}); + +task("clean", function () { + return src("./dist/", { allowEmpty: true }).pipe(vinylPaths(del)); +}); + +task("compile", series("static", "sass", "cat")); + +task("watch", function () { + watch(["./public/**/*", "./src/**/*"], series("compile")); +}); + +task("build", series("clean", "compile"));