/
.eslintrc.js
197 lines (144 loc) · 5.5 KB
/
.eslintrc.js
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
module.exports = {
extends: 'eslint:recommended',
parserOptions: {
'ecmaVersion': 6,
sourceType: 'module'
},
globals: {
Promise: true
},
env: {
node: true,
browser: true
},
rules: {
// http://eslint.org/docs/rules/indent
'indent': ['error', 4, {
SwitchCase: 1
}],
// http://eslint.org/docs/rules/quotes
'quotes': ['error', 'single', {
avoidEscape: true,
allowTemplateLiterals: true
}],
// http://eslint.org/docs/rules/linebreak-style
'linebreak-style': ['error', 'unix'],
// http://eslint.org/docs/rules/semi
'semi': ['error', 'always'],
// http://eslint.org/docs/rules/no-unused-vars
'no-unused-vars': ['warn'],
// http://eslint.org/docs/rules/brace-style
'brace-style': ['error', '1tbs'],
// http://eslint.org/docs/rules/operator-linebreak
'operator-linebreak': ['error', 'after'],
// http://eslint.org/docs/rules/camelcase
'camelcase': ['error', {properties: 'never'}],
// http://eslint.org/docs/rules/valid-jsdoc
'valid-jsdoc': ['error', {
prefer: {returns: 'return'},
preferType: {
string: 'String',
number: 'Number',
object: 'Object',
array: 'Array',
function: 'Function',
boolean: 'Boolean'
},
requireReturn: false,
requireParamDescription: false,
requireReturnDescription: false
}],
// http://eslint.org/docs/rules/max-len
'max-len': ['error', {
code: 200,
ignoreComments: true,
ignoreRegExpLiterals: true
}],
// http://eslint.org/docs/rules/no-console
'no-console': [0],
// http://eslint.org/docs/rules/no-debugger
'no-debugger': ['error'],
// http://eslint.org/docs/rules/no-alert
'no-alert': ['error'],
// http://eslint.org/docs/rules/no-multi-str
'no-multi-str': ['error'],
// http://eslint.org/docs/rules/no-mixed-spaces-and-tabs
'no-mixed-spaces-and-tabs': ['error'],
// http://eslint.org/docs/rules/no-trailing-spaces
'no-trailing-spaces': ['error'],
// http://eslint.org/docs/rules/space-unary-ops
'space-unary-ops': ['error', {}],
// http://eslint.org/docs/rules/space-infix-ops
'space-infix-ops': ['error'],
// http://eslint.org/docs/rules/comma-spacing
'comma-spacing': ['error', {before: false, after: true}],
// http://eslint.org/docs/rules/no-with
'no-with': ['error'],
// http://eslint.org/docs/rules/keyword-spacing
'keyword-spacing': ['error', {after: true}],
// http://eslint.org/docs/rules/no-multi-spaces
'no-multi-spaces': ['error'],
// http://eslint.org/docs/rules/no-eval
'no-eval': ['error'],
// http://eslint.org/docs/rules/no-extra-label
'no-extra-label': ['error'],
// http://eslint.org/docs/rules/no-extra-bind
'no-extra-bind': ['error'],
// http://eslint.org/docs/rules/no-cond-assign
'no-cond-assign': ['error'],
// http://eslint.org/docs/rules/no-constant-condition
'no-constant-condition': ['error'],
// http://eslint.org/docs/rules/no-dupe-args
'no-dupe-args': ['error'],
// http://eslint.org/docs/rules/no-dupe-keys
'no-dupe-keys': ['error'],
// http://eslint.org/docs/rules/no-empty
'no-empty': ['error'],
// http://eslint.org/docs/rules/no-extra-semi
'no-extra-semi': ['error'],
// http://eslint.org/docs/rules/no-unreachable
'no-unreachable': ['error'],
// http://eslint.org/docs/rules/no-mixed-operators
'no-mixed-operators': ['error'],
// http://eslint.org/docs/rules/no-floating-decimal
'no-floating-decimal': ['error'],
// http://eslint.org/docs/rules/no-multi-spaces
'no-multi-spaces': ['error'],
// http://eslint.org/docs/rules/object-curly-spacing
'object-curly-spacing': ['error', 'never'],
// http://eslint.org/docs/rules/array-bracket-spacing
'array-bracket-spacing': ['error', 'never'],
// http://eslint.org/docs/rules/space-before-function-paren
'space-before-function-paren': ['error', 'always'],
// http://eslint.org/docs/rules/space-before-blocks
'space-before-blocks': ['error', 'always'],
// http://eslint.org/docs/rules/yoda
'yoda': ['error', 'never'],
// http://eslint.org/docs/rules/use-isnan
'use-isnan': ['error'],
// http://eslint.org/docs/rules/radix
'radix': ['error'],
// http://eslint.org/docs/rules/#possible-errors
'func-call-spacing': ['error', 'never'],
// http://eslint.org/docs/rules/complexity
'complexity': ['error', {
max: 10
}],
// http://eslint.org/docs/rules/max-depth
'max-depth': ['error', {
max: 4
}],
// http://eslint.org/docs/rules/max-nested-callbacks
'max-nested-callbacks': ['error', {
max: 3
}],
// http://eslint.org/docs/rules/max-params
'max-params': ['error', {
max: 7
}],
// http://eslint.org/docs/rules/max-statements
'max-statements': ['error', {
max: 10
}]
}
};