-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc
131 lines (131 loc) · 3.84 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
{
"parserOptions": {
"parser": "babel-eslint",
"ecmaVersion": 6,
"sourceType": "module",
},
"rules": {
// redundant
"no-console": "off",
"no-extra-boolean-cast": "off",
"no-prototype-builtins": "off",
// text safe
"eol-last": [ "warn", "always" ],
"indent": "off",
"indent-legacy": [ "warn", 2 ],
"linebreak-style": [ "warn", "unix" ],
"no-trailing-spaces": "warn",
"no-multiple-empty-lines": [ "warn", { "max": 1 }],
// spacing safe
"key-spacing": [ "warn", { "mode": "minimum" }],
"arrow-spacing": "warn",
"block-spacing": [ "warn", "always" ],
"comma-spacing": "warn",
"keyword-spacing": "warn",
"space-in-parens": "warn",
"space-unary-ops": "warn",
"func-call-spacing": [ "warn", "never" ],
"rest-spread-spacing": "warn",
"space-before-blocks": "warn",
"object-curly-spacing": [ "warn", "always" ],
"array-bracket-spacing": [ "warn", "never", {
"arraysInArrays": false,
"objectsInArrays": false
}],
"computed-property-spacing": "warn",
"space-before-function-paren": [ "warn", {
"anonymous": "never",
"named": "ignore",
"asyncArrow": "always"
}],
"no-whitespace-before-property": "warn",
// vars safe
"prefer-const": "warn",
"no-var": "warn",
"no-unused-vars": [ "warn", {
"args": "all",
"argsIgnorePattern": "^_",
"caughtErrors": "all",
"caughtErrorsIgnorePattern": "^_"
}],
"no-unused-expressions": [ "warn", {
"allowTernary": true
}],
// vars unsafe
"no-shadow-restricted-names": "error",
// code-style safe
"semi": [ "warn", "never" ],
"curly": [ "warn", "multi-line", "consistent" ],
"eqeqeq": [ "warn", "always" ],
"quotes": [ "warn", "single", { "avoidEscape": true }],
"wrap-iife": "warn",
"brace-style": "warn",
"comma-style": "warn",
"quote-props": [ "warn", "as-needed" ],
"comma-dangle": [ "warn", "never"],
"no-extra-parens": [ "warn", "functions" ],
"no-new-wrappers": "warn",
"no-useless-call": "warn",
"no-throw-literal": "warn",
"no-empty-function": "off", // warn
"no-useless-escape": "warn",
"no-useless-rename": "warn",
"no-useless-computed-key": "warn",
"no-template-curly-in-string": "warn",
"no-misleading-character-class": "warn",
// code-style unsafe
"new-parens": "error",
"guard-for-in": "error",
"array-callback-return": "error",
"no-eval": "error",
"no-void": "error",
"no-with": "error",
"no-labels": "error",
"no-bitwise": "error",
"no-loop-func": "error",
"no-multi-str": "error",
"no-sequences": "error",
"no-lone-blocks": "error",
"no-implied-eval": "error",
"no-octal-escape": "error",
"no-self-compare": "error",
"no-useless-catch": "error",
"no-useless-return": "error",
"no-floating-decimal": "error",
"no-use-before-define": [ "error", {
"classes": false,
"variables": false,
"functions": false
}],
"no-unmodified-loop-condition": "error",
// code-style unsafe, but may be necessary during development
"no-alert": "warn",
"no-debugger": "warn"
},
"env": {
"node": true,
"jasmine": true,
"jest": true,
"browser": false // browser env allows using "length" variable
// and many other variables with common names
// defined in global object
},
"globals": {
"Node": true,
"window": true,
"NodeList": true,
"document": true,
"console": true,
"setInterval": true,
"setTimeout": true,
"setImmediate": true,
"clearInterval": true,
"clearTimeout": true,
"clearImmediate": true,
"cancelIdleCallback": true,
"requestIdleCallback": true,
"cancelAnimationFrame": true,
"requestAnimationFrame": true
},
"extends": ["eslint:recommended"]
}