-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.js
180 lines (178 loc) · 6.39 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
module.exports = {
"env": {
"node": true,
"commonjs": true,
"es6": true,
"mocha": true
},
"extends": [
"eslint:recommended"
],
"parserOptions": {
"ecmaVersion": 2018
},
"rules": {
// Bad Practices
"curly": "error",
"no-await-in-loop": "error",
"no-eval": "error",
"no-implicit-globals": "error",
"no-lone-blocks": "error",
"no-return-await": "error",
"no-self-compare": "error",
"no-sequences": "error",
"no-throw-literal": "error",
"no-with": "error",
"prefer-arrow-callback": [ "error", { "allowNamedFunctions": true } ],
"prefer-promise-reject-errors": "error",
"prefer-rest-params": "warn",
"no-label-var": "error",
"no-undefined": "off",
"no-use-before-define": "error",
"no-array-constructor": "error",
"no-new-object": "error",
"no-continue": "error",
"no-unneeded-ternary": "error",
// Common Mistakes
"no-extra-bind": "warn",
"no-floating-decimal": "warn",
"no-multi-spaces": "warn",
"no-useless-call": "warn",
"no-useless-return": "warn",
"require-await": "off",
"no-mixed-operators": "warn",
// Style
"array-bracket-newline": [ "warn", "consistent" ],
"array-bracket-spacing": [ "warn", "always" ],
"array-element-newline": [ "warn", "consistent" ],
"arrow-parens": [ "warn", "always" ],
"arrow-spacing": "warn",
"block-spacing": "warn",
"brace-style": [ "warn", "allman", { "allowSingleLine": true } ],
"camelcase": "warn",
"comma-dangle": [ "warn", "never" ],
"comma-spacing": [ "warn", { "before": false, "after": true } ],
"comma-style": [ "warn", "last" ],
"computed-property-spacing": [ "warn", "never" ],
"consistent-this": [ "warn", "self" ],
"eol-last": [ "warn", "always" ],
"func-call-spacing": ["warn", "never"],
"func-style": [ "warn", "declaration", { "allowArrowFunctions": true } ],
"function-paren-newline": [ "warn", "multiline" ],
"generator-star-spacing": [ "warn", { "before": true, "after": false } ],
"id-length": [ "warn", { "min": 2, "exceptions": [ "_", "a", "b", "i", "x", "y", "z" ] } ],
"indent": [
"warn",
4,
{
"SwitchCase": 1,
"VariableDeclarator": 1,
"outerIIFEBody": 1,
"MemberExpression": 1,
"FunctionDeclaration": {
"parameters": 1,
"body": 1
},
"FunctionExpression": {
"parameters": 1,
"body": 1
},
"CallExpression": {
"arguments": 1
},
"ArrayExpression": 1,
"ObjectExpression": 1,
"ImportDeclaration": 1,
"flatTernaryExpressions": false
}
],
"key-spacing": [ "warn", { "beforeColon": false, "afterColon": true } ],
"keyword-spacing": [
"warn",
{
"overrides": {
"if": { "after": false },
"for": { "after": false },
"while": { "after": false }
}
}
],
"lines-between-class-members": [ "warn", "always", { exceptAfterSingleLine: true } ],
"new-parens": "warn",
"newline-per-chained-call": [ "warn", { "ignoreChainWithDepth": 2 } ],
"no-confusing-arrow": [ "warn", { "allowParens": false } ],
"no-duplicate-imports": "warn",
"no-lonely-if": "warn",
"no-multi-assign": "warn",
"no-multiple-empty-lines": [ "warn", { "max": 1, "maxBOF": 0, "maxEOF": 1 } ],
"no-useless-computed-key": "warn",
"no-useless-rename": [
"error",
{
"ignoreDestructuring": false,
"ignoreImport": false,
"ignoreExport": false
}
],
"no-var": "warn",
"no-whitespace-before-property": "warn",
"object-curly-spacing": [ "warn", "always" ],
"object-property-newline": [ "warn", { "allowAllPropertiesOnSameLine": true } ],
"object-shorthand": [ "warn", "always" ],
"one-var": [ "warn", "never" ],
"operator-linebreak": [ "warn", "before" ],
"padded-blocks": [ "warn", "never" ],
"prefer-const": "warn",
"prefer-object-spread": "warn",
"prefer-template": "warn",
"quote-props": [ "warn", "consistent-as-needed" ],
"quotes": [ "warn", "single", { "avoidEscape": true, "allowTemplateLiterals": true } ],
"semi": [ "error", "always" ],
"semi-spacing": [ "warn", { "before": false, "after": true } ],
"space-before-blocks": "warn",
"space-before-function-paren": [ "warn", "never" ],
"space-in-parens": [ "warn", "never" ],
"space-infix-ops": "warn",
"space-unary-ops": "warn",
"spaced-comment": [
"warn",
"always", {
"line": {
"markers": [ "/" ],
"exceptions": [ "-", "+" ]
},
"block": {
"markers": ["!"],
"exceptions": ["*"],
"balanced": true
}
}
],
"switch-colon-spacing": "warn",
"template-curly-spacing": [ "warn", "always" ],
"template-tag-spacing": "warn",
"valid-jsdoc": [
"warn",
{
"prefer": {
"arg": "param",
"argument": "param",
"class": "class",
"return": "returns",
"virtual": "abstract"
},
"preferType": {
"Boolean": "boolean",
"Number": "number",
"Object": "object",
"String": "string"
},
"requireReturn": true,
"requireParamDescription": true,
"requireParamType": true
}
],
"yield-star-spacing": [ "warn", "before" ],
"yoda": [ "warn", "never", { "exceptRange": true } ]
}
};