-
Notifications
You must be signed in to change notification settings - Fork 1
/
core.js
executable file
·280 lines (275 loc) · 9.15 KB
/
core.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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
module.exports = {
env: {
browser: true,
node: true,
mocha: true,
},
rules: {
quotes: ['error', 'single', { avoidEscape: true, allowTemplateLiterals: true }],
'no-use-before-define': ['error', { functions: false, classes: true, variables: false }],
'no-unused-expressions': 'off',
strict: 'off',
'new-cap': 'off',
'comma-dangle': ['error', 'always-multiline'],
'max-statements': ['error', 50],
'max-len': ['error', 150, 2],
'max-depth': ['error', 4],
'max-nested-callbacks': ['error', 5],
indent: ['error', 2, { SwitchCase: 1 }],
'brace-style': ['error', '1tbs'],
'spaced-line-comment': 'off',
// possible errors
'array-callback-return': 'error',
'arrow-body-style': 'off',
'arrow-parens': ['error', 'as-needed'],
'arrow-spacing': ['error', { before: true, after: true }],
'block-scoped-var': 'error',
'block-spacing': 'error',
'callback-return': 'off',
'global-require': 'off',
'handle-callback-err': 'error',
'init-declarations': 'off',
'space-infix-ops': 'error',
'no-cond-assign': 'error',
'no-confusing-arrow': ['error', { allowParens: true }],
'no-console': ['error', { allow: ['error', 'warn', 'trace'] }],
'no-const-assign': 'error',
'no-constant-condition': 'error',
'no-control-regex': 'error',
'no-empty-function': 'off',
'no-debugger': 'error',
'no-dupe-args': 'error',
'no-dupe-class-members': 'error',
'no-dupe-keys': 'error',
'no-duplicate-case': 'error',
'no-duplicate-imports': 'error',
'no-empty': 'error',
'no-empty-character-class': 'error',
'no-empty-pattern': 'error',
'no-ex-assign': 'error',
'no-extra-boolean-cast': 'off',
'no-extra-label': 'error',
'no-extra-parens': 'off',
'no-extra-semi': 'error',
'no-func-assign': 'error',
'no-inner-declarations': 'error',
'no-invalid-regexp': 'error',
'no-irregular-whitespace': 'error',
'no-negated-in-lhs': 'error',
'no-obj-calls': 'error',
'no-process-env': 'off',
'no-regex-spaces': 'error',
'no-reserved-keys': 'off',
'no-self-assign': 'error',
'no-sparse-arrays': 'error',
'no-unexpected-multiline': 'error',
'no-unmodified-loop-condition': 'error',
'no-unreachable': 'error',
'no-unsafe-finally': 'error',
'no-unused-labels': 'error',
'no-useless-call': 'error',
'require-yield': 'error',
'unicode-bom': ['error', 'never'],
'use-isnan': 'error',
'valid-jsdoc': ['off'],
'valid-typeof': 'error',
// best practices
'accessor-pairs': 'error',
'no-var': 'error',
'prefer-const': 'error',
complexity: ['off'],
'consistent-return': 'off',
curly: 'error',
'default-case': 'error',
'dot-notation': 'error',
'dot-location': ['error', 'property'],
eqeqeq: 'error',
'guard-for-in': 'error',
'no-alert': 'error',
'no-caller': 'error',
'no-div-regex': 'error',
'no-else-return': 'off',
'no-labels': 'error',
'no-eq-null': 'error',
'no-eval': 'error',
'no-extend-native': 'error',
'no-extra-bind': 'error',
'no-fallthrough': 'error',
'no-floating-decimal': 'error',
'no-implied-eval': 'error',
'no-implicit-coercion': 'off',
'no-implicit-globals': 'error',
'no-invalid-this': 'error',
'no-iterator': 'error',
'no-label-var': 'error',
'no-lone-blocks': 'error',
'no-loop-func': 'error',
'no-magic-numbers': 'off',
'no-mixed-operators': 'off',
'no-mixed-requires': 'off',
'no-multi-spaces': 'error',
'no-multi-str': 'error',
'no-native-reassign': 'error',
'no-new-func': 'error',
'no-new-wrappers': 'error',
'no-new': 'error',
'no-octal-escape': 'error',
'no-octal': 'error',
'no-param-reassign': 'off',
'no-path-concat': 'error',
'no-process-exit': 'error',
'no-proto': 'error',
'no-prototype-builtins': 'off',
'no-redeclare': 'error',
'no-restricted-globals': 'error',
'no-restricted-syntax': ['error', 'WithStatement'],
'no-return-assign': 'off',
'no-script-url': 'error',
'no-self-compare': 'error',
'no-sequences': 'error',
'no-sync': 'off',
'no-throw-literal': 'error',
'no-useless-computed-key': 'error',
'no-useless-concat': 'error',
'no-useless-constructor': 'error',
'no-useless-escape': 'off',
'no-useless-rename': 'error',
'no-void': 'error',
'no-warning-comments': ['error', { terms: ['fixme'], location: 'anywhere' }],
'no-whitespace-before-property': 'error',
'no-with': 'off',
radix: 'error',
'vars-on-top': 'error',
'wrap-iife': ['error', 'inside'],
yoda: 'error',
'no-await-in-loop': 'error',
// variables
'no-catch-shadow': 'error',
'no-delete-var': 'error',
'no-shadow-restricted-names': 'error',
'no-shadow': 'error',
'no-undef-init': 'error',
'no-undef': 'error',
'no-undefined': 'off',
'no-unused-vars': ['error', { args: 'after-used' }],
// stylistic
'array-bracket-spacing': ['error', 'never'],
camelcase: ['error', { properties: 'always' }],
'comma-spacing': ['error', { before: false, after: true }],
'comma-style': ['error', 'last'],
'computed-property-spacing': ['error', 'never'],
'consistent-this': 'off',
'eol-last': 'error',
'func-names': 'off',
'func-style': ['off', 'declaration'],
'id-blacklist': 'error',
'id-length': 'off',
'id-match': 'off',
'key-spacing': ['error', { beforeColon: false, afterColon: true }],
'keyword-spacing': ['error', { before: true, after: true }],
'lines-around-comment': 'off',
'linebreak-style': ['error', 'unix'],
'max-lines': ['error', { max: 500, skipBlankLines: false, skipComments: false }],
'max-statements-per-line': ['error', { max: 1 }],
'multiline-ternary': 'off',
'new-parens': 'error',
'newline-after-var': 'off',
'newline-before-return': 'off',
'newline-per-chained-call': 'off',
'no-array-constructor': 'error',
'no-case-declarations': 'error',
'no-class-assign': 'error',
'no-continue': 'error',
'no-inline-comments': 'off',
'no-lonely-if': 'error',
'no-mixed-spaces-and-tabs': 'error',
'no-multiple-empty-lines': ['error', { max: 1 }],
'no-negated-condition': 'off',
'no-nested-ternary': 'error',
'no-new-object': 'error',
'no-new-require': 'error',
'no-new-symbol': 'error',
'no-spaced-func': 'error',
'no-ternary': 'off',
'no-trailing-spaces': ['error', { skipBlankLines: true }],
'no-underscore-dangle': 'off',
'no-unneeded-ternary': 'error',
'object-curly-spacing': 'off',
'object-curly-newline': 'off',
'object-property-newline': 'off',
'one-var': ['error', 'never'],
'one-var-declaration-per-line': 'error',
'operator-assignment': 'off',
'operator-linebreak': ['error', 'before'],
'padded-blocks': 'off',
'prefer-arrow-callback': ['error', { allowNamedFunctions: true, allowUnboundThis: true }],
'prefer-rest-params': 'error',
'prefer-spread': 'error',
'prefer-template': 'error',
'quote-props': ['error', 'as-needed'],
'require-jsdoc': 'off',
'rest-spread-spacing': ['error', 'never'],
'semi-spacing': ['error', { before: false, after: true }],
semi: ['error', 'always'],
'sort-vars': 'off',
'sort-imports': 'off',
'space-before-blocks': ['error', 'always'],
'space-before-function-paren': ['error', 'never'],
'space-in-parens': ['error', 'never'],
'space-unary-ops': ['error', { words: true, nonwords: false }],
'spaced-comment': ['error', 'always', {
line: {
markers: ['/'],
exceptions: ['-'],
},
block: {
balanced: true,
markers: ['!'],
exceptions: ['*'],
},
}],
'template-curly-spacing': ['error', 'never'],
'wrap-regex': 'off',
'yield-star-spacing': ['error', { before: false, after: true }],
'constructor-super': 'error',
'generator-star-spacing': ['error', 'after'],
'no-this-before-super': 'error',
'object-shorthand': ['error', 'properties'],
'max-params': ['error', 5],
'no-bitwise': 'error',
'no-plusplus': 'off',
'no-restricted-imports': 'off',
'no-restricted-modules': 'off',
'prefer-reflect': 'off',
'array-bracket-newline': 'off',
'array-element-newline': 'off',
'capitalized-comments': 'off',
'class-methods-use-this': 'off',
'for-direction': 'off',
'func-call-spacing': 'off',
'func-name-matching': 'off',
'getter-return': 'off',
'jsx-quotes': 'off',
'line-comment-position': 'off',
'no-buffer-constructor': 'off',
'no-compare-neg-zero': 'off',
'no-global-assign': 'off',
'no-multi-assign': 'off',
'no-restricted-properties': 'off',
'no-return-await': 'off',
'no-tabs': 'off',
'no-template-curly-in-string': 'off',
'no-unsafe-negation': 'off',
'no-useless-return': 'off',
'nonblock-statement-body-position': 'off',
'padding-line-between-statements': 'off',
'prefer-destructuring': 'off',
'prefer-numeric-literals': 'off',
'prefer-promise-reject-errors': 'off',
'require-await': 'off',
'semi-style': 'off',
'sort-keys': 'off',
'switch-colon-spacing': 'off',
'symbol-description': 'off',
},
};