@@ -316,6 +316,7 @@ ruleTester.run('sort-comp', rule, {
316
316
'class Hello extends React.Component {' ,
317
317
' foo = () => {}' ,
318
318
' constructor() {}' ,
319
+ ' static bar = () => {}' ,
319
320
' render() {' ,
320
321
' return <div>{this.props.text}</div>;' ,
321
322
' }' ,
@@ -325,7 +326,6 @@ ruleTester.run('sort-comp', rule, {
325
326
options : [ {
326
327
order : [
327
328
'instance-methods' ,
328
- 'static-methods' ,
329
329
'lifecycle' ,
330
330
'everything-else' ,
331
331
'render'
@@ -335,9 +335,10 @@ ruleTester.run('sort-comp', rule, {
335
335
// Instance variables should be at the top
336
336
code : [
337
337
'class Hello extends React.Component {' ,
338
- ' foo = " bar" ' ,
338
+ ' foo = \' bar\' ' ,
339
339
' constructor() {}' ,
340
340
' state = {}' ,
341
+ ' static bar = \'foo\'' ,
341
342
' render() {' ,
342
343
' return <div>{this.props.text}</div>;' ,
343
344
' }' ,
@@ -347,7 +348,6 @@ ruleTester.run('sort-comp', rule, {
347
348
options : [ {
348
349
order : [
349
350
'instance-variables' ,
350
- 'static-methods' ,
351
351
'lifecycle' ,
352
352
'everything-else' ,
353
353
'render'
@@ -563,18 +563,18 @@ ruleTester.run('sort-comp', rule, {
563
563
code : [
564
564
'class Hello extends React.Component {' ,
565
565
' constructor() {}' ,
566
+ ' static bar = () => {}' ,
566
567
' foo = () => {}' ,
567
568
' render() {' ,
568
569
' return <div>{this.props.text}</div>;' ,
569
570
' }' ,
570
571
'}'
571
572
] . join ( '\n' ) ,
572
573
parser : 'babel-eslint' ,
573
- errors : [ { message : 'constructor should be placed after foo ' } ] ,
574
+ errors : [ { message : 'foo should be placed before constructor ' } ] ,
574
575
options : [ {
575
576
order : [
576
577
'instance-methods' ,
577
- 'static-methods' ,
578
578
'lifecycle' ,
579
579
'everything-else' ,
580
580
'render'
@@ -586,7 +586,8 @@ ruleTester.run('sort-comp', rule, {
586
586
'class Hello extends React.Component {' ,
587
587
' constructor() {}' ,
588
588
' state = {}' ,
589
- ' foo = "bar"' ,
589
+ ' static bar = {}' ,
590
+ ' foo = {}' ,
590
591
' render() {' ,
591
592
' return <div>{this.props.text}</div>;' ,
592
593
' }' ,
@@ -597,7 +598,6 @@ ruleTester.run('sort-comp', rule, {
597
598
options : [ {
598
599
order : [
599
600
'instance-variables' ,
600
- 'static-methods' ,
601
601
'lifecycle' ,
602
602
'everything-else' ,
603
603
'render'
0 commit comments