Skip to content

Commit e9b59b7

Browse files
committed
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.
1 parent 2626e0b commit e9b59b7

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

linters/.eslintrc

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -190,18 +190,23 @@
190190
"react/wrap-multilines": 2,
191191
"react/sort-comp": [2, {
192192
"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",
193+
'displayName',
194+
'propTypes',
195+
'contextTypes',
196+
'childContextTypes',
197+
'mixins',
198+
'statics',
199+
'defaultProps',
200+
'getDefaultProps',
201+
'getInitialState',
202+
'getChildContext',
203+
'componentWillMount',
204+
'componentDidMount',
205+
'componentWillReceiveProps',
206+
'shouldComponentUpdate',
207+
'componentWillUpdate',
208+
'componentDidUpdate',
209+
'componentWillUnmount',
205210
"/^on.+$/",
206211
"/^get.+$/",
207212
"/^render.+$/",

0 commit comments

Comments
 (0)