diff --git a/docs/rules/sort-comp.md b/docs/rules/sort-comp.md index d0b26486c6..20ea7098e2 100644 --- a/docs/rules/sort-comp.md +++ b/docs/rules/sort-comp.md @@ -9,7 +9,7 @@ When creating React components it is more convenient to always follow the same o The default configuration ensures that the following order must be followed: 1. static methods and properties - 2. lifecycle methods: `displayName`, `propTypes`, `contextTypes`, `childContextTypes`, `mixins`, `statics`, `defaultProps`, `constructor`, `getDefaultProps`, `state`, `getInitialState`, `getChildContext`, `getDerivedStateFromProps`, `componentWillMount`, `UNSAFE_componentWillMount`, `componentDidMount`, `componentWillReceiveProps`, `UNSAFE_componentWillReceiveProps`, `shouldComponentUpdate`, `componentWillUpdate`, `UNSAFE_componentWillUpdate`, `getSnapshotBeforeUpdate`, `componentDidUpdate`, `componentDidCatch`, `componentWillUnmount` (in this order). + 2. lifecycle methods: `displayName`, `propTypes`, `contextType`, `contextTypes`, `childContextTypes`, `mixins`, `statics`, `defaultProps`, `constructor`, `getDefaultProps`, `state`, `getInitialState`, `getChildContext`, `getDerivedStateFromProps`, `componentWillMount`, `UNSAFE_componentWillMount`, `componentDidMount`, `componentWillReceiveProps`, `UNSAFE_componentWillReceiveProps`, `shouldComponentUpdate`, `componentWillUpdate`, `UNSAFE_componentWillUpdate`, `getSnapshotBeforeUpdate`, `componentDidUpdate`, `componentDidCatch`, `componentWillUnmount` (in this order). 3. custom methods 4. `render` method diff --git a/lib/rules/sort-comp.js b/lib/rules/sort-comp.js index 752a53bd38..49c36453d1 100644 --- a/lib/rules/sort-comp.js +++ b/lib/rules/sort-comp.js @@ -24,6 +24,7 @@ const defaultConfig = { lifecycle: [ 'displayName', 'propTypes', + 'contextType', 'contextTypes', 'childContextTypes', 'mixins',