add eslint and editorconfig

This commit is contained in:
Thomas Ruoff
2017-02-14 22:26:44 +01:00
parent 1be838f589
commit b33f877971
4 changed files with 100 additions and 0 deletions

15
.editorconfig Normal file
View File

@@ -0,0 +1,15 @@
; EditorConfig file: http://EditorConfig.org
; Install the "EditorConfig" plugin into Sublime Text to use
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
[package.json]
indent_size = 2

81
.eslintrc Normal file
View File

@@ -0,0 +1,81 @@
{
"env": {
"node": true,
"browser": true,
"es6": true
},
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
"rules": {
"array-bracket-spacing": [2, "never", {"singleValue": false}],
"arrow-spacing": [2, {"before": true, "after": true}],
"brace-style": 2,
"camelcase": [2, {"properties": "never"}],
"comma-style": [2, "last"],
"complexity": [2, 10],
"constructor-super": 2,
"curly": [2, "all"],
"eol-last": 2,
"eqeqeq": 2,
"guard-for-in": 2,
"generator-star-spacing": [2, {"before": false, "after": true}],
"indent": [2, 4, {"SwitchCase": 1}],
"key-spacing": [2, {"beforeColon": false, "afterColon": true}],
"keyword-spacing": [2, {
"overrides": {
"catch": {"after": true},
"do": {"after": true},
"else": {"after": true},
"for": {"after": true},
"if": {"after": true},
"return": {"after": true},
"switch": {"after": true},
"try": {"after": true},
"while": {"after": true}
}
}],
"linebreak-style": [2, "unix"],
"max-depth": [2, 3],
"max-len": [2, 140],
"max-params": [1, 4],
"max-statements": [2, 20],
"new-cap": [2, { "capIsNewExceptions": ["Q"] }],
"no-eval": 2,
"no-bitwise": 2,
"no-caller": 2,
"no-class-assign": 2,
"no-const-assign": 2,
"no-dupe-class-members": 2,
"no-empty": 2,
"no-mixed-spaces-and-tabs": 2,
"no-multi-spaces": 2,
"no-multi-str": 2,
"no-new": 2,
"no-this-before-super": 2,
"no-trailing-spaces": 2,
"no-undef": 2,
"no-unused-vars": 2,
"no-use-before-define": [2, "nofunc"],
"no-var": 0,
"no-with": 2,
"object-shorthand": 0,
"prefer-arrow-callback ": 0,
"prefer-const": 0,
"prefer-spread": 0,
"prefer-reflect": 0,
"prefer-template": 0,
"quotes": [2, "single", "avoid-escape"],
"require-yield": 0,
"semi": 2,
"space-before-function-paren": [2, "never"],
"space-unary-ops": [2, {"words": false, "nonwords": false}],
"space-infix-ops": 2,
"strict": [2, "global"],
"wrap-iife": 2
},
"globals": {
"chrome": true
}
}

1
.gitignore vendored
View File

@@ -1 +1,2 @@
node_modules
.tern-project

View File

@@ -11,5 +11,8 @@
"dependencies": {
"body-parser": "^1.16.1",
"express": "^4.14.1"
},
"devDependencies": {
"eslint": "^3.15.0"
}
}