-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.eslintrc
56 lines (49 loc) · 2.11 KB
/
.eslintrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
{
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
"env": {
"browser": true,
"node": true,
"es6": true
},
"extends": [
"eslint:recommended"
],
"rules": {
"semi": ["error", "always"],
"eqeqeq": ["error", "always"], // `===`/`!===` instead of `==`/`!=`
"no-var": "error", // `let`/`const` instead of `var`
"prefer-const": "error", // `const` instead of `let`
/* ----- useless code ------ */
"no-lonely-if": "error", // `else if` instead of `else { if {`
/* ------ debug leftovers ----- */
"no-alert": "error", // no `window.alert` or `window.prompt`
/* ------ shorthand / es6 ----- */
"no-array-constructor": "error", // `[1, 2]` instead of `new Array(1, 2)`
"no-new-object": "error", // `{}` instead of `new Object()`
"prefer-rest-params": "error", // `(...args)` instead of `arguments`
"prefer-spread": "error", // `fn(...xs)` instead of `fn.apply(xs)`
"prefer-arrow-callback": "error",
/* ----- complexity ----- */
"max-statements-per-line": "warn",
"max-statements": ["warn", 100],
"max-params": ["warn", 8],
"max-nested-callbacks": ["warn", 4],
"max-depth": ["warn", 4],
"max-lines": ["warn", 1000],
/* ----- stylistic ------ */
"new-cap": "error",
"camelcase": "error",
"brace-style": ["error", "stroustrup"],
"indent": "error",
"curly": ["error", "multi"], // curly braces around multiple statements only
"block-spacing": "error",
"dot-notation": "error", // `x.y` instead of `x["y"]`
"rest-spread-spacing": ["error", "never"], // `...xs` instead of `... xs`
"arrow-spacing": ["error", { "before": true, "after": true }], // `x => x` instead of `x=>x`
"space-in-parens": ["error", "never"],
"object-curly-spacing": ["error", "always"],
}
}