-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
149 lines (145 loc) · 3.75 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
module.exports = {
root: true,
parser: 'babel-eslint',
extends: ['airbnb'],
plugins: ['flowtype'],
env: {
browser: true,
es6: true,
jest: true
},
rules: {
'no-console': 'warn',
'no-debugger': 'warn',
'arrow-parens': ['error', 'as-needed'],
'function-paren-newline': ['error', 'consistent'],
'no-shadow': 'off',
'no-bitwise': ['error', {
allow: ['~'],
}],
'no-plusplus': ['error', {
allowForLoopAfterthoughts: true,
}],
'no-empty': ['error', {
allowEmptyCatch: true,
}],
"operator-linebreak": ["error", "after"],
"react/destructuring-assignment": "off",
"react/button-has-type": "off", // https://github.com/yannickcr/eslint-plugin-react/issues/1846
"lines-between-class-members": ["error", "always", { "exceptAfterSingleLine": true }],
"react/jsx-one-expression-per-line": "off",
"max-len": ["error", 120, 2, {
"ignoreUrls": true,
"ignoreComments": false,
"ignoreRegExpLiterals": false,
"ignoreStrings": false,
"ignoreTemplateLiterals": false
}],
'object-curly-newline': ['error', {
ObjectExpression: {
multiline: true,
consistent: true
},
ObjectPattern: {
multiline: true,
consistent: true
},
ImportDeclaration: {
multiline: true,
consistent: true
},
ExportDeclaration: {
multiline: true,
consistent: true
},
}],
"import/no-extraneous-dependencies": ["error", {
devDependencies: ['**/*.test.js', '**/*.spec.js', '**/*.config.js'],
optionalDependencies: false,
peerDependencies: true
}],
'jsx-a11y/anchor-is-valid': 'off',
'jsx-a11y/click-events-have-key-events': 'off',
'jsx-a11y/media-has-caption': 'off',
'jsx-a11y/no-static-element-interactions': 'off',
'jsx-a11y/label-has-for': ['error', {
required: {
some: [ 'nesting', 'id' ]
}
}],
'react/jsx-closing-tag-location': 'error',
'react/jsx-sort-props': ['error', {
shorthandFirst: true,
noSortAlphabetically: false,
callbacksLast: true,
reservedFirst: true,
ignoreCase: true
}],
'react/sort-prop-types': ['error', {
callbacksLast: true,
requiredFirst: true,
sortShapeProp: true
}],
'react/sort-comp': ['warn', {
order: [
'type-annotations',
'instance-variables',
'static-methods',
'lifecycle',
'everything-else',
'/^on.+$/',
'/^render.+$/',
'render'
]
}],
'react/jsx-filename-extension': ['error', {
extensions: ['.js'],
}],
'react/require-default-props': 'off',
'react/default-props-match-prop-types': ["error", {
allowRequiredDefaults: true,
}],
"flowtype/boolean-style": [
"error",
"boolean"
],
"flowtype/define-flow-type": "error",
"flowtype/delimiter-dangle": [
"error",
"always-multiline"
],
"flowtype/generic-spacing": [
"error",
"never"
],
"flowtype/no-primitive-constructor-types": "error",
"flowtype/no-types-missing-file-annotation": "error",
"flowtype/object-type-delimiter": [
"error",
"comma"
],
"flowtype/no-weak-types": "error",
"flowtype/require-valid-file-annotation": ["error", "never", { "annotationStyle": "block" }],
"flowtype/semi": [
"error",
"always"
],
"flowtype/space-after-type-colon": [
"error",
"always"
],
"flowtype/space-before-generic-bracket": [
"error",
"never"
],
"flowtype/space-before-type-colon": [
"error",
"never"
],
"flowtype/union-intersection-spacing": [
"error",
"always"
],
"flowtype/use-flow-type": "warn",
},
};