Skip to content

Commit 5f2c88f

Browse files
refactor: Re-sort sort-comp rule.
1 parent 1cc54a3 commit 5f2c88f

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

rules/general.js

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -596,31 +596,36 @@ module.exports = {
596596
* }]
597597
*/
598598
"react/sort-comp": ["error", {
599-
"order": [
600-
"static-methods",
599+
order: [
600+
"static-variables",
601601
"instance-variables",
602-
"lifecycle",
603-
"/^on.+$/",
604-
"getters",
605-
"setters",
606-
"/^(get|set)(?!(InitialState$|DefaultProps$|ChildContext$)).+$/",
602+
"lifecycle-variables",
603+
"static-methods",
607604
"instance-methods",
605+
"event-methods",
608606
"everything-else",
607+
"lifecycle-methods",
609608
"rendering",
610609
],
611-
"groups": {
612-
"lifecycle": [
610+
groups: {
611+
"event-methods": [
612+
"/^handle.+$/",
613+
"/^on.+$/",
614+
],
615+
"lifecycle-variables": [
613616
'displayName',
614617
'propTypes',
615618
'contextTypes',
616619
'childContextTypes',
617620
'mixins',
618621
'statics',
619622
'defaultProps',
623+
'state',
624+
],
625+
"lifecycle-methods": [
620626
'constructor',
621627
'getDefaultProps',
622628
'getInitialState',
623-
'state',
624629
'getChildContext',
625630
'getDerivedStateFromProps',
626631
'componentWillMount',

0 commit comments

Comments
 (0)