-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc
226 lines (179 loc) · 7.28 KB
/
.eslintrc
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
{
"parser": "babel-eslint",
"extends": ["eslint:recommended", "plugin:react/recommended", "prettier", "prettier/react"],
"plugins": ["prettier", "react", "emotion"],
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"env": {
"browser": true,
"es6": true,
"node": true,
"jest": true
},
"globals": {
"spyOn": true
},
"settings": {
"react": {
"version": "detect"
}
},
"rules": {
"no-console": "off",
"no-inner-declarations": "off",
"valid-jsdoc": "off",
"require-jsdoc": "off",
"quotes": ["error", "single"],
"import/no-unresolved": "off",
"react/jsx-pascal-case": "off",
"import/order": "off",
"babel/camelcase": "off",
"jsx-a11y/label-has-for": "off",
"max-lines-per-function": "off",
"consistent-return": ["error"],
"no-extra-semi": "error",
"arrow-body-style": ["error", "as-needed", { "requireReturnForObjectLiteral": true }],
"react/display-name": "off",
"jsx-quotes": ["error", "prefer-double"],
"object-curly-spacing": ["error", "always"],
"no-duplicate-imports": "error",
// http://eslint.org/docs/rules/array-callback-return
"array-callback-return": "error",
// http://eslint.org/docs/rules/curly
"curly": ["error", "all"],
// http://eslint.org/docs/rules/no-eval
"no-eval": "error",
// http://eslint.org/docs/rules/no-implied-eval
"no-implied-eval": "error",
// http://eslint.org/docs/rules/no-param-reassign
"no-param-reassign": ["error", { "props": true }],
// http://eslint.org/docs/rules/no-return-assign
"no-return-assign": "error",
// http://eslint.org/docs/rules/no-self-compare
"no-self-compare": "error",
// http://eslint.org/docs/rules/radix
"radix": "error",
// http://eslint.org/docs/rules/no-array-constructor
"no-array-constructor": "error",
// http://eslint.org/docs/rules/no-new-wrappers
"no-new-wrappers": "error",
// http://eslint.org/docs/rules/no-cond-assign
"no-cond-assign": "error",
// http://eslint.org/docs/rules/no-use-before-define
"no-use-before-define": ["error", { "functions": false }],
// https://eslint.org/docs/rules/no-undef
"no-undef": "error",
// http://eslint.org/docs/rules/eqeqeq
"eqeqeq": "error",
// http://eslint.org/docs/rules/no-new-object
"no-new-object": "error",
// https://eslint.org/docs/rules/no-nested-ternary
"no-nested-ternary": "error",
// http://eslint.org/docs/rules/no-unused-vars
"no-unused-vars": ["error", { "ignoreRestSiblings": true }],
// http://eslint.org/docs/rules/no-var
"no-var": "error",
// http://eslint.org/docs/rules/prefer-const
"prefer-const": "error",
// https://eslint.org/docs/rules/prefer-arrow-callback
"prefer-arrow-callback": "error",
// http://eslint.org/docs/rules/new-cap
"new-cap": [
"error",
{
"capIsNewExceptions": [
"Collection",
"DropTarget",
"DragDropContext",
"DragSource",
"Map",
"List",
"OrderedMap",
"OrderedSet",
"Record",
"Seq",
"Set"
]
}
],
// https://eslint.org/docs/rules/object-shorthand
"object-shorthand": ["error", "properties"],
// https://eslint.org/docs/rules/no-useless-computed-key
"no-useless-computed-key": "error",
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-undef.md
"react/jsx-no-undef": "error",
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-direct-mutation-state.md
"react/no-direct-mutation-state": "error",
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/react-in-jsx-scope.md
"react/react-in-jsx-scope": "error",
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-boolean-value.md
"react/jsx-boolean-value": "error",
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-duplicate-props.md
"react/jsx-no-duplicate-props": "error",
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-key.md
"react/jsx-key": "error",
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-uses-react.md
"react/jsx-uses-react": "error",
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-uses-vars.md
"react/jsx-uses-vars": "error",
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unknown-property.md
"react/no-unknown-property": "error",
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prop-types.md
"react/prop-types": "off",
// "react/prop-types": [
// "error",
// {
// "ignore": ["children", "className"]
// }
// ],
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-target-blank.md
"react/jsx-no-target-blank": "error",
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-string-refs.md
"react/no-string-refs": "error",
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/boolean-prop-naming.md
"react/boolean-prop-naming": "error",
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/forbid-foreign-prop-types.md
"react/forbid-foreign-prop-types": "error",
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-is-mounted.md
"react/no-is-mounted": "error",
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-render-return-value.md
"react/no-render-return-value": "error",
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/void-dom-elements-no-children.md
"react/void-dom-elements-no-children": "error",
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-typos.md
"react/no-typos": "error",
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-access-state-in-setstate.md
"react/no-access-state-in-setstate": "error",
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unescaped-entities.md
"react/no-unescaped-entities": ["error", { "forbid": [">", "}"] }],
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unused-prop-types.md
"react/no-unused-prop-types": "error",
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-find-dom-node.md
"react/no-find-dom-node": "error",
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prefer-es6-class.md
"react/prefer-es6-class": "error",
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-deprecated.md
"react/no-deprecated": "error",
"emotion/jsx-import": "error",
"emotion/no-vanilla": "error",
"emotion/import-from-emotion": "error",
"emotion/styled-import": "error"
},
"overrides": [
{
"files": ["packages/**/gatsby-browser.js", "packages/gatsby/cache-dir/**/*"],
"env": {
"browser": true
},
"globals": {
"___loader": false,
"___emitter": false
}
}
]
}