-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
227 lines (223 loc) · 6.75 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
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
module.exports = {
parser: 'babel-eslint',
rules: {
/**
* General Rules
*/
// Errors
'linebreak-style': [2, 'unix'],
'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: 'ForOfStatement',
message:
'iterators/generators require regenerator-runtime, which is too heavyweight for this guide to allow them. Separately, loops should be avoided in favor of array iterations.',
},
{
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.',
},
{
selector: 'CallExpression[callee.name="xdescribe"]',
message:
'`xdescribe` is disallowed in the build. If this test suite really needs to be skipped, disable the `no-restricted-syntax` rule with a reason to ignore the test',
},
{
selector: 'CallExpression[callee.name="xit"]',
message:
'`xit` is disallowed in the build. If this test really needs to be skipped, disable the `no-restricted-syntax` rule with a reason to ignore the test',
},
{
selector: 'CallExpression[callee.name="fdescribe"]',
message:
'Focused specs are not allowed to be checked in because all the tests need to run in CI.',
},
{
selector: 'CallExpression[callee.name="fit"]',
message:
'Focused specs are not allowed to be checked in because all the tests need to run in CI.',
},
],
// Warnings
'prefer-destructuring': 1,
'prefer-promise-reject-errors': 1,
'no-else-return': 1,
'dot-notation': 1,
'prefer-template': 1,
'object-shorthand': 1,
'no-use-before-define': [1, {functions: false}],
'no-param-reassign': 1,
'no-shadow': 1,
'prefer-rest-params': 1,
'no-return-assign': 1,
// Ignore
semi: [0, 'always'],
'no-plusplus': 0,
'no-unused-expressions': 0,
'no-continue': 0,
'no-prototype-builtins': 0,
'import/no-named-as-default': 0,
'class-methods-use-this': 0, // Tells you to make everything static that doesn't reference `this`
'prefer-arrow-callback': 0,
'func-names': 0,
'import/extensions': [0, 'always'],
'import/first': 0,
'import/no-extraneous-dependencies': 0, // Doesn't like our import structure
'import/no-unresolved': 0, // Doesn't like our import structure
'consistent-return': 0, // Flow knows what each method can return so we can handle all cases
'no-underscore-dangle': 0,
'wrap-iife': 0,
'no-mixed-operators': 0,
/**
* Ignore style rules because of prettier
*/
'space-infix-ops': 0,
'array-bracket-spacing': 0,
'block-spacing': 0,
'brace-style': 0,
camelcase: 0,
'capitalized-comments': 0,
'comma-spacing': 0,
'comma-style': 0,
'computed-property-spacing': 0,
'consistent-this': 0,
'eol-last': 0,
'func-call-spacing': 0,
'func-name-matching': 0,
'func-names': 0,
'func-style': 0,
'function-paren-newline': 0,
'id-blacklist': 'off',
'id-length': 'off',
'id-match': 'off',
indent: 0,
'key-spacing': 0,
'keyword-spacing': 0,
'line-comment-position': 0,
'linebreak-style': 0,
'lines-around-comment': 'off',
'lines-around-directive': 0,
'max-depth': 0,
'max-len': 0,
'max-lines': 0,
'max-nested-callbacks': 'off',
'max-params': ['off', 3],
'max-statements': ['off', 10],
'max-statements-per-line': ['off', {max: 1}],
'multiline-ternary': ['off', 'never'],
'new-cap': 0,
'new-parens': 0,
'newline-after-var': 'off',
'newline-before-return': 'off',
'newline-per-chained-call': 0,
'no-array-constructor': 0,
'no-bitwise': 0,
'no-continue': 0,
'no-confusing-arrow': 0, // Turning off because it fights with prettier sometimes
'no-inline-comments': 'off',
'no-lonely-if': 0,
'no-mixed-operators': 0,
'no-mixed-spaces-and-tabs': 0,
'no-multi-assign': 0,
'no-multiple-empty-lines': 0,
'no-negated-condition': 'off',
'no-nested-ternary': 0,
'no-new-object': 'warn',
'no-plusplus': 0,
'no-spaced-func': 0,
'no-tabs': 0,
'no-ternary': 'off',
'no-trailing-spaces': 0,
'no-underscore-dangle': 0,
'no-unneeded-ternary': 0,
'no-whitespace-before-property': 0,
'nonblock-statement-body-position': 'off',
'object-curly-spacing': 0,
'object-curly-newline': 0,
'object-property-newline': 0,
'one-var': 0,
'one-var-declaration-per-line': 0,
'operator-assignment': 0,
'operator-linebreak': 'off',
'padded-blocks': 0,
'quote-props': 0,
quotes: 0,
'require-jsdoc': 'off',
semi: 0,
'semi-spacing': 0,
'sort-keys': 0,
'sort-vars': 'off',
'space-before-blocks': 0,
'space-before-function-paren': 0,
'space-in-parens': 0,
'space-infix-ops': 0,
'space-unary-ops': 0,
'spaced-comment': 0,
'template-tag-spacing': ['off', 'never'],
'unicode-bom': 0,
'wrap-regex': 'off',
'import/prefer-default-export': 0,
'arrow-body-style': [0, 'as-needed'],
curly: [0, 'multi-line'],
'one-var-declaration-per-line': 0,
'one-var': 0,
'no-spaced-func': 0,
'func-call-spacing': 0, // Dup
'comma-dangle': [0, 'always-multiline'],
'max-len': 0,
'space-in-parens': [0, 'never'],
'padded-blocks': [0, 'never'],
'comma-spacing': 0,
'no-multi-spaces': 0,
'key-spacing': [0, {beforeColon: false, afterColon: true}],
'object-property-newline': 0,
'space-before-blocks': [0, 'always'],
'arrow-spacing': 0,
'keyword-spacing': 0,
'quote-props': [0, 'as-needed'],
'template-curly-spacing': [0, 'never'],
'array-bracket-spacing': [0, 'never'],
'object-curly-spacing': [0, 'never'],
'space-before-function-paren': [0, 'always'],
'brace-style': [0, 'stroustrup'],
'arrow-parens': [0, 'as-needed'],
'eol-last': 0,
'default-case': 0,
'block-spacing': 0,
'no-lonely-if': 0,
},
extends: 'airbnb',
env: {
es6: true,
browser: true,
jasmine: true,
node: true,
},
parserOptions: {
ecmaVersion: 6,
sourceType: 'module',
ecmaFeatures: {
experimentalObjectRestSpread: true,
},
},
plugins: ['flowtype'],
globals: {
TimeoutID: false,
IntervalID: false,
jest: false,
T: false,
$Subtype: false,
$Enum: false,
},
};