mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2024-11-10 17:04:49 +08:00
moved eslint config definition above use
This commit is contained in:
parent
153efd9a6a
commit
1ac401dbfa
1 changed files with 31 additions and 31 deletions
62
gulpfile.js
62
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"));
|
||||
|
|
Loading…
Reference in a new issue