mirror of
https://github.com/airbnb/javascript.git
synced 2026-04-25 03:00:19 -04:00
Update .eslintrc with other react class properties
In `eslint-plugin-react`'s page on their sorting rules they show the order I showed here. https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/sort-comp.md#rule-options I noticed because according to the current rules `contextTypes` goes below `render` and I also noticed other methods were missing from the list. Since we're being specific we should also include the other methods and properties that `eslint-plugin-react` handles by default.
This commit is contained in:
@@ -190,18 +190,23 @@
|
||||
"react/wrap-multilines": 2,
|
||||
"react/sort-comp": [2, {
|
||||
"order": [
|
||||
"displayName",
|
||||
"mixins",
|
||||
"statics",
|
||||
"propTypes",
|
||||
"getDefaultProps",
|
||||
"getInitialState",
|
||||
"componentWillMount",
|
||||
"componentDidMount",
|
||||
"componentWillReceiveProps",
|
||||
"shouldComponentUpdate",
|
||||
"componentWillUpdate",
|
||||
"componentWillUnmount",
|
||||
'displayName',
|
||||
'propTypes',
|
||||
'contextTypes',
|
||||
'childContextTypes',
|
||||
'mixins',
|
||||
'statics',
|
||||
'defaultProps',
|
||||
'getDefaultProps',
|
||||
'getInitialState',
|
||||
'getChildContext',
|
||||
'componentWillMount',
|
||||
'componentDidMount',
|
||||
'componentWillReceiveProps',
|
||||
'shouldComponentUpdate',
|
||||
'componentWillUpdate',
|
||||
'componentDidUpdate',
|
||||
'componentWillUnmount',
|
||||
"/^on.+$/",
|
||||
"/^get.+$/",
|
||||
"/^render.+$/",
|
||||
|
||||
Reference in New Issue
Block a user