Skip to content

Commit 20c4d37

Browse files
author
Jake Teton-Landis
committed
add eslint rules for JSX style from issue airbnb#345
1 parent 874fb87 commit 20c4d37

File tree

1 file changed

+44
-1
lines changed

1 file changed

+44
-1
lines changed

linters/.eslintrc

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
22
"parser": "babel-eslint",
3+
"plugins": [
4+
"react"
5+
],
36
"env": {
47
"browser": true,
58
"node": true
@@ -164,6 +167,46 @@
164167
"space-before-function-paren": [2, "never"], // http://eslint.org/docs/rules/space-before-function-paren
165168
"space-infix-ops": 2, // http://eslint.org/docs/rules/space-infix-ops
166169
"space-return-throw-case": 2, // http://eslint.org/docs/rules/space-return-throw-case
167-
"spaced-line-comment": 2 // http://eslint.org/docs/rules/spaced-line-comment
170+
"spaced-line-comment": 2, // http://eslint.org/docs/rules/spaced-line-comment
171+
172+
/**
173+
* JSX style
174+
*/
175+
"react/display-name": 0,
176+
"react/jsx-boolean-value": 2,
177+
"react/jsx-quotes": [2, "double"],
178+
"react/jsx-no-undef": 2,
179+
"react/jsx-sort-props": 0,
180+
"react/jsx-sort-prop-types": 0,
181+
"react/jsx-uses-react": 2,
182+
"react/jsx-uses-vars": 2,
183+
"react/no-did-mount-set-state": [2, "allow-in-func"],
184+
"react/no-did-update-set-state": 2,
185+
"react/no-multi-comp": 2,
186+
"react/no-unknown-property": 2,
187+
"react/prop-types": 2,
188+
"react/react-in-jsx-scope": 2,
189+
"react/self-closing-comp": 2,
190+
"react/wrap-multilines": 2,
191+
"react/sort-comp": [2, {
192+
"order": [
193+
"displayName",
194+
"mixins",
195+
"statics",
196+
"propTypes",
197+
"getDefaultProps",
198+
"getInitialState",
199+
"componentWillMount",
200+
"componentDidMount",
201+
"componentWillReceiveProps",
202+
"shouldComponentUpdate",
203+
"componentWillUpdate",
204+
"componentWillUnmount",
205+
"/^on.+$/",
206+
"/^get.+$/",
207+
"/^render.+$/",
208+
"render"
209+
]
210+
}]
168211
}
169212
}

0 commit comments

Comments
 (0)