@@ -469,13 +469,14 @@ ruleTester.run('jsx-curly-brace-presence', rule, {
469
469
features : [ 'no-ts' ] ,
470
470
options : [ 'never' ] ,
471
471
} ,
472
+ // legit as this single template literal might be used for stringifying
472
473
{
473
- code : '<App label={`${label}${suffix} `} />' ,
474
- options : [ { props : 'never' } ] ,
474
+ code : '<App label={`${label}`} />' ,
475
+ options : [ 'never' ] ,
475
476
} ,
476
477
{
477
- code : '<App>{`${label}${suffix} `}</App>' ,
478
- options : [ { children : 'never' } ] ,
478
+ code : '<App>{`${label}`}</App>' ,
479
+ options : [ 'never' ] ,
479
480
}
480
481
) ) ,
481
482
@@ -786,23 +787,23 @@ ruleTester.run('jsx-curly-brace-presence', rule, {
786
787
} ,
787
788
{
788
789
code : `
789
- <App prop="
790
- a
790
+ <App prop="${ ' ' }
791
+ a${ ' ' }
791
792
b c
792
793
d
793
794
">
794
795
a
795
- b c
796
- d
796
+ b c${ ' ' }
797
+ d${ ' ' }
797
798
</App>
798
799
` ,
799
800
errors : [
800
801
{ messageId : 'missingCurly' } , { messageId : 'missingCurly' } ,
801
802
] ,
802
803
options : [ 'always' ] ,
803
804
output : `
804
- <App prop="
805
- a
805
+ <App prop="${ ' ' }
806
+ a${ ' ' }
806
807
b c
807
808
d
808
809
">
@@ -814,23 +815,23 @@ ruleTester.run('jsx-curly-brace-presence', rule, {
814
815
} ,
815
816
{
816
817
code : `
817
- <App prop='
818
- a
818
+ <App prop='${ ' ' }
819
+ a${ ' ' }
819
820
b c
820
821
d
821
822
'>
822
823
a
823
- b c
824
- d
824
+ b c${ ' ' }
825
+ d${ ' ' }
825
826
</App>
826
827
` ,
827
828
errors : [
828
829
{ messageId : 'missingCurly' } , { messageId : 'missingCurly' } ,
829
830
] ,
830
831
options : [ 'always' ] ,
831
832
output : `
832
- <App prop='
833
- a
833
+ <App prop='${ ' ' }
834
+ a${ ' ' }
834
835
b c
835
836
d
836
837
'>
@@ -939,18 +940,6 @@ ruleTester.run('jsx-curly-brace-presence', rule, {
939
940
errors : [ { messageId : 'unnecessaryCurly' } ] ,
940
941
options : [ { props : 'never' , children : 'never' , propElementValues : 'never' } ] ,
941
942
features : [ 'no-ts' ] ,
942
- } ,
943
- {
944
- code : '<App label={`${label}`} />' ,
945
- output : '<App label={label} />' ,
946
- errors : [ { messageId : 'unnecessaryCurly' } ] ,
947
- options : [ { props : 'never' , children : 'never' , propElementValues : 'never' } ] ,
948
- } ,
949
- {
950
- code : '<App>{`${label}`}</App>' ,
951
- output : '<App>{label}</App>' ,
952
- errors : [ { messageId : 'unnecessaryCurly' } ] ,
953
- options : [ { props : 'never' , children : 'never' , propElementValues : 'never' } ] ,
954
943
}
955
944
) ) ,
956
945
} ) ;
0 commit comments