mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2026-01-06 23:44:19 +08:00
added eslint@6.0.0, gulp-eslint, babel-eslint dev dependencies. added linting to the concatenated source. removed a duplicate function to allow it to build.
This commit is contained in:
parent
92214e7b45
commit
56e2910a4d
4 changed files with 1227 additions and 5 deletions
74
gulpfile.js
74
gulpfile.js
|
|
@ -2,6 +2,7 @@ const { task, src, dest, series, watch } = require("gulp");
|
|||
const concat = require("gulp-concat");
|
||||
const del = require("del");
|
||||
const vinylPaths = require("vinyl-paths");
|
||||
const eslint = require("gulp-eslint");
|
||||
var sass = require("gulp-sass");
|
||||
sass.compiler = require("dart-sass");
|
||||
|
||||
|
|
@ -20,7 +21,12 @@ const gulpSrc = [
|
|||
];
|
||||
|
||||
task("cat", function () {
|
||||
return src(gulpSrc).pipe(concat("monkeytype.js")).pipe(dest("./dist/js"));
|
||||
return src(gulpSrc)
|
||||
.pipe(concat("monkeytype.js"))
|
||||
.pipe(eslint(eslintConfig))
|
||||
.pipe(eslint.format())
|
||||
.pipe(eslint.failAfterError())
|
||||
.pipe(dest("./dist/js"));
|
||||
});
|
||||
|
||||
task("sass", function () {
|
||||
|
|
@ -44,3 +50,69 @@ task("watch", function () {
|
|||
});
|
||||
|
||||
task("rebuild", series("clean", "build"));
|
||||
|
||||
let eslintConfig = {
|
||||
parser: "babel-eslint",
|
||||
extends: "eslint:recommended",
|
||||
globals: ["jQuery", "$", "firebase"],
|
||||
envs: ["es6", "browser", "node"],
|
||||
rules: {
|
||||
"constructor-super": "error",
|
||||
"for-direction": "error",
|
||||
"getter-return": "error",
|
||||
"no-async-promise-executor": "error",
|
||||
"no-case-declarations": "error",
|
||||
"no-class-assign": "error",
|
||||
"no-compare-neg-zero": "error",
|
||||
"no-cond-assign": "error",
|
||||
"no-const-assign": "error",
|
||||
"no-constant-condition": "error",
|
||||
"no-control-regex": "error",
|
||||
"no-debugger": "error",
|
||||
"no-delete-var": "error",
|
||||
"no-dupe-args": "error",
|
||||
"no-dupe-class-members": "error",
|
||||
"no-dupe-else-if": "error",
|
||||
"no-dupe-keys": "error",
|
||||
"no-duplicate-case": "error",
|
||||
"no-empty": "error",
|
||||
"no-empty-character-class": "error",
|
||||
"no-empty-pattern": "error",
|
||||
"no-ex-assign": "error",
|
||||
"no-extra-boolean-cast": "error",
|
||||
"no-extra-semi": "error",
|
||||
"no-fallthrough": "error",
|
||||
"no-func-assign": "error",
|
||||
"no-global-assign": "error",
|
||||
"no-import-assign": "error",
|
||||
"no-inner-declarations": "error",
|
||||
"no-invalid-regexp": "error",
|
||||
"no-irregular-whitespace": "error",
|
||||
"no-misleading-character-class": "error",
|
||||
"no-mixed-spaces-and-tabs": "error",
|
||||
"no-new-symbol": "error",
|
||||
"no-obj-calls": "error",
|
||||
"no-octal": "error",
|
||||
"no-prototype-builtins": "error",
|
||||
"no-redeclare": "error",
|
||||
"no-regex-spaces": "error",
|
||||
"no-self-assign": "error",
|
||||
"no-setter-return": "error",
|
||||
"no-shadow-restricted-names": "error",
|
||||
"no-sparse-arrays": "error",
|
||||
"no-this-before-super": "error",
|
||||
"no-undef": "error",
|
||||
"no-unexpected-multiline": "error",
|
||||
"no-unreachable": "error",
|
||||
"no-unsafe-finally": "error",
|
||||
"no-unsafe-negation": "error",
|
||||
"no-unused-labels": "error",
|
||||
"no-unused-vars": "error",
|
||||
"no-useless-catch": "error",
|
||||
"no-useless-escape": "error",
|
||||
"no-with": "error",
|
||||
"require-yield": "error",
|
||||
"use-isnan": "error",
|
||||
"valid-typeof": "error",
|
||||
},
|
||||
};
|
||||
|
|
|
|||
1151
package-lock.json
generated
1151
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -13,11 +13,14 @@
|
|||
"node": "10"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-eslint": "^10.1.0",
|
||||
"concurrently": "^5.3.0",
|
||||
"dart-sass": "^1.25.0",
|
||||
"del": "^6.0.0",
|
||||
"eslint": "^6.0.0",
|
||||
"gulp": "^4.0.2",
|
||||
"gulp-concat": "^2.6.1",
|
||||
"gulp-eslint": "^6.0.0",
|
||||
"gulp-sass": "^4.1.0",
|
||||
"husky": "^4.3.0",
|
||||
"prettier": "2.1.2",
|
||||
|
|
|
|||
|
|
@ -1,7 +1,3 @@
|
|||
function capitalizeFirstLetter(str) {
|
||||
return str.charAt(0).toUpperCase() + str.slice(1);
|
||||
}
|
||||
|
||||
function addChildCommands(
|
||||
unifiedCommands,
|
||||
commandItem,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue