-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.json
174 lines (174 loc) · 5.02 KB
/
.eslintrc.json
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
{
"env": {
"es6": true,
"node": true,
"jest": true
},
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 6,
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"jsx": true
},
"sourceType": "module"
},
"plugins": [
// "graphql",
"react"
],
"extends": [
"standard",
"standard-react"
],
"settings": {
"react": {
"createClass": "createReactClass",
"pragma": "React",
"version": "detect",
"flowVersion": "0.53"
}
},
"rules": {
// overrides
// off
"camelcase": "off",
"react/react-in-jsx-scope": "off",
// warn
"react/boolean-prop-naming": "warn",
"react/forbid-prop-types": "warn",
"react/no-children-prop": "warn",
"react/no-deprecated": "warn",
// error
"curly": "error",
"no-var": "error",
"no-case-declarations": "error",
"no-console": ["error", {
"allow": ["warn", "error"]
}],
"no-empty": "error",
"sort-imports": ["error", {
"ignoreCase": true,
"ignoreMemberSort": false,
"memberSyntaxSortOrder": ["multiple", "single", "all", "none"]
}],
// "graphql/capitalized-type-name": ['warn', {
// "schemaJson": require("./graphql/schema.json")
// }],
// "graphql/named-operations": ['error', {
// "schemaJson": require("./graphql/schema.json")
// }],
// "graphql/required-fields": ['error', {
// "requiredFields": ["id"],
// "env": "apollo",
// "schemaJson": require("./graphql/schema.json")
// }],
// "graphql/template-strings": ["error", {
// "validators": "all",
// "env": "apollo",
// "schemaJson": require("./graphql/schema.json")
// }],
"react/jsx-closing-bracket-location": "error",
"react/jsx-closing-tag-location": "error",
"react/jsx-first-prop-new-line": ["error", "multiline-multiprop"],
"react/jsx-handler-names": ["error", {
"eventHandlerPrefix": "_?(on|set)"
}],
"react/jsx-max-props-per-line": ["error", {
"maximum": 1,
"when": "multiline"
}],
"react/jsx-no-bind": ["error", {
"allowArrowFunctions": false,
"allowBind": false,
"ignoreRefs": true
}],
"react/jsx-no-comment-textnodes": "error",
"react/jsx-no-literals": "error",
"react/jsx-pascal-case": "error",
"react/jsx-sort-props": ["error", {
"callbacksLast": true,
"shorthandFirst": true,
"ignoreCase": true
}],
"react/jsx-tag-spacing": ["error", {
"closingSlash": "never",
"beforeSelfClosing": "always",
"afterOpening": "never"
}],
"react/jsx-wrap-multilines": "error",
"react/no-multi-comp": ["error", {
"ignoreStateless": true
}],
"react/no-redundant-should-component-update": "error",
"react/no-set-state": "error",
"react/no-string-refs": "error",
"react/no-unescaped-entities": "error",
"react/no-unused-prop-types": "error",
"react/no-will-update-set-state": "error",
"react/prefer-stateless-function": ["error", {
"ignorePureComponents": true
}],
"react/prop-types": ["error", {
"skipUndeclared": true
}],
"react/prefer-es6-class": ["error", "always"],
"react/require-render-return": "error",
"react/sort-comp": ["error", {
"order": [
"static-methods",
"lifecycle",
"everything-else",
"event-handling",
"rendering"
],
"groups": {
"lifecycle": [
"displayName",
"propTypes",
"contextTypes",
"childContextTypes",
"mixins",
"statics",
"defaultProps",
"constructor",
"getDefaultProps",
"getInitialState",
"state",
"getChildContext",
"componentWillMount",
"componentDidMount",
"componentWillReceiveProps",
"shouldComponentUpdate",
"componentWillUpdate",
"componentDidUpdate",
"componentWillUnmount"
],
"event-handling": [
"/^_?on.+$/"
],
"rendering": [
"/^_?render.+$/",
"render"
]
}
}],
"react/sort-prop-types": ["error", {
"callbacksLast": true,
"ignoreCase": true,
"requiredFirst": true
}]
},
"globals": {
"describe": true,
"it": true,
"expect": true,
"fetch": true,
"navigator": true,
"__DEV__": true,
"XMLHttpRequest": true,
"FileReader": true,
"FormData": true,
"React$Element": true
}
}