-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
152 lines (150 loc) · 4.57 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
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
module.exports = {
env: {
es6: true,
node: true,
},
extends: [
'eslint:recommended',
],
plugins: [
'import',
'eslint-comments',
],
rules: {
// eslint-base
'arrow-body-style': ['error', 'as-needed', { requireReturnForObjectLiteral: true }],
'arrow-parens': 'off',
'brace-style': ['error', 'stroustrup', { allowSingleLine: true }],
'camelcase': 'error',
'class-methods-use-this': 'off',
'comma-dangle': ['error', 'always-multiline'],
'comma-spacing': ['error', { before: false, after: true }],
'comma-style': ['error', 'last'],
'complexity': ['error', { max: 10 }],
'constructor-super': 'error',
'curly': ['error', 'all'],
'default-case': 'error',
'default-case-last': 'error',
'dot-notation': 'error',
'eol-last': 'error',
'eqeqeq': ['error', 'always'],
'func-style': ['error', 'declaration'],
'guard-for-in': 'off',
'id-blacklist': [
'error',
'any',
'Number',
'number',
'String',
'string',
'Boolean',
'boolean',
'Undefined',
'undefined',
],
'id-match': 'error',
'indent': ['error', 2, { SwitchCase: 1 }],
'key-spacing': [1, { beforeColon: false, afterColon: true, mode: 'minimum' }],
'keyword-spacing': ['error', { after: true }],
'linebreak-style': ['error', 'unix'],
'lines-between-class-members': ['error', 'always'],
'max-classes-per-file': ['error', 1],
'max-len': ['error', { code: 140 }],
'max-lines': 'off',
'new-cap': 'error',
'new-parens': 'error',
'no-bitwise': 'error',
'no-caller': 'error',
'no-cond-assign': 'error',
'no-console': 'off',
'no-debugger': 'error',
'no-empty': 'error',
'no-eval': 'error',
'no-fallthrough': 'error',
'no-floating-decimal': 'error',
'no-invalid-this': 'off',
'no-irregular-whitespace': 'error',
'no-magic-numbers': 'off',
'no-mixed-operators': 'error',
'no-process-exit': 'off',
'no-nested-ternary': 'error',
'no-new-wrappers': 'error',
'no-null/no-null': 'off',
'no-redeclare': 'error',
'no-shadow': 'off',
'no-template-curly-in-string': 'error',
'no-throw-literal': 'error',
'no-trailing-spaces': 'error',
'no-undef-init': 'error',
'no-underscore-dangle': 'off',
'no-unreachable': 'error',
'no-unsafe-finally': 'error',
'no-unused-expressions': 'error',
'no-unused-labels': 'error',
'no-unused-vars': 'error',
'no-use-before-define': 'error',
'no-var': 'error',
'no-void': 'error',
'object-shorthand': 'error',
'one-var': [
'error',
'never',
],
'operator-linebreak': ['error', 'before', { overrides: { '+': 'after' }}],
'padding-line-between-statements': 'off',
'prefer-arrow/prefer-arrow-functions': 'off',
'prefer-const': 'error',
'prefer-object-spread': 'error',
'prefer-template': 'off',
'quote-props': 'off',
'quotes': ['error', 'single', 'avoid-escape'],
'radix': 'off',
'space-before-blocks': 'error',
'space-before-function-paren': ['error', {
anonymous: 'always',
named: 'never',
asyncArrow: 'always',
}],
'spaced-comment': 'error',
'space-in-parens': ['error', 'never'],
'use-isnan': 'error',
'valid-typeof': 'off',
'wrap-iife': 'error',
'yoda': 'error',
// eslint-plugin-eslint-comment
'eslint-comments/disable-enable-pair': ['error', {
allowWholeFile: true,
}],
'eslint-comments/no-aggregating-enable': 'error',
'eslint-comments/no-duplicate-disable': 'error',
'eslint-comments/no-unlimited-disable': 'error',
'eslint-comments/no-unused-disable': 'error',
'eslint-comments/no-unused-enable': 'error',
'eslint-comments/no-use': ['error', {
allow: [
'eslint-disable',
'eslint-disable-line',
'eslint-disable-next-line',
'eslint-enable',
],
}],
// eslint-plugin-import
'import/first': 'error',
'import/newline-after-import': 'error',
'import/no-absolute-path': 'error',
'import/no-amd': 'error',
'import/no-default-export': 'error',
'import/no-extraneous-dependencies': ['error', {
devDependencies: true,
peerDependencies: true,
optionalDependencies: false,
}],
'import/no-mutable-exports': 'error',
'import/no-named-default': 'error',
'import/no-named-export': 'off', // we want everything to be a named export
'import/no-self-import': 'error',
'import/prefer-default-export': 'off', // we want everything to be named
'import/no-unassigned-import': 'off',
'import/order': 'off',
},
};