-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
84 lines (81 loc) · 2.78 KB
/
index.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
module.exports = {
extends : 'airbnb-base',
parserOptions: { ecmaVersion: 2020 },
env : {
node: true,
},
plugins: [
'node',
'promise',
],
rules: {
// Include rules in standard that are not in airbnb:
// https://github.com/transloadit/node-sdk/issues/90
'accessor-pairs' : ['error', { setWithoutGet: true, enforceForClassMembers: true }],
'default-case-last' : 'error',
'no-useless-backreference' : 'error',
'no-extra-parens' : ['error', 'functions'],
'no-import-assign' : 'error',
'no-loss-of-precision' : 'error',
'no-unmodified-loop-condition': 'error',
'no-unreachable-loop' : 'error',
'no-useless-call' : 'error',
'prefer-regex-literals' : ['error', { disallowRedundantWrapping: true }],
'node/handle-callback-err' : ['error', '^(err|error)$'],
'node/no-callback-literal' : 'error',
'node/no-deprecated-api' : 'error',
'node/no-exports-assign' : 'error',
'node/no-new-require' : 'error',
'node/no-path-concat' : 'error',
'node/process-exit-as-throw' : 'error',
'promise/param-names' : 'error',
// Selectively override certain airbnb rules from standard:
semi : ['error', 'never'],
'space-before-function-paren': ['error', 'always'],
'object-curly-newline' : ['error', { multiline: true, consistent: true }],
// Override/disable certain airbnb rules:
'no-plusplus' : 0,
'max-classes-per-file': 0,
'max-len' : 0,
'no-underscore-dangle': [
'error', {
allow : [],
allowAfterThis : true,
allowAfterSuper : true,
enforceInMethodNames: false,
},
],
'no-restricted-syntax': [
'error',
{
selector: 'ForInStatement',
message : 'for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array.',
},
{
selector: 'LabeledStatement',
message : 'Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.',
},
{
selector: 'WithStatement',
message : '`with` is disallowed in strict mode because it makes code impossible to predict and optimize.',
},
],
// transloadit custom rules:
'key-spacing': [
'error',
{
multiLine: {
beforeColon: false,
afterColon : true,
},
align: {
beforeColon: false,
afterColon : true,
on : 'colon',
mode : 'strict',
},
},
],
'no-multi-spaces': 0,
},
}