moved eslint config definition above use

This commit is contained in:
typer 2020-11-02 17:53:53 -08:00
parent 153efd9a6a
commit 1ac401dbfa

View file

@ -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"));