@@ -38,6 +38,10 @@ ruleTester.run('jsx-max-props-per-line', rule, {
3838 code : '<App foo bar />' ,
3939 options : [ { when : 'multiline' } ] ,
4040 parserOptions : parserOptions
41+ } , {
42+ code : '<App foo {...this.props} />' ,
43+ options : [ { when : 'multiline' } ] ,
44+ parserOptions : parserOptions
4145 } , {
4246 code : '<App foo bar baz />' ,
4347 options : [ { maximum : 2 , when : 'multiline' } ] ,
@@ -109,6 +113,46 @@ ruleTester.run('jsx-max-props-per-line', rule, {
109113 ] . join ( '\n' ) ,
110114 errors : [ { message : 'Prop `bar` must be placed on a new line' } ] ,
111115 parserOptions : parserOptions
116+ } , {
117+ code : [
118+ '<App foo={{' ,
119+ '}} bar />'
120+ ] . join ( '\n' ) ,
121+ errors : [ { message : 'Prop `bar` must be placed on a new line' } ] ,
122+ parserOptions : parserOptions
123+ } , {
124+ code : [
125+ '<App foo bar={{' ,
126+ '}} baz />'
127+ ] . join ( '\n' ) ,
128+ options : [ { maximum : 2 } ] ,
129+ errors : [ { message : 'Prop `baz` must be placed on a new line' } ] ,
130+ parserOptions : parserOptions
131+ } , {
132+ code : [
133+ '<App foo={{' ,
134+ '}} {...rest} />'
135+ ] . join ( '\n' ) ,
136+ errors : [ { message : 'Prop `rest` must be placed on a new line' } ] ,
137+ parserOptions : parserOptions
138+ } , {
139+ code : [
140+ '<App {' ,
141+ ' ...this.props' ,
142+ '} bar />'
143+ ] . join ( '\n' ) ,
144+ errors : [ { message : 'Prop `bar` must be placed on a new line' } ] ,
145+ parserOptions : parserOptions
146+ } , {
147+ code : [
148+ '<App {' ,
149+ ' ...this.props' ,
150+ '} {' ,
151+ ' ...rest' ,
152+ '} />'
153+ ] . join ( '\n' ) ,
154+ errors : [ { message : 'Prop `rest` must be placed on a new line' } ] ,
155+ parserOptions : parserOptions
112156 } , {
113157 code : [
114158 '<App' ,
0 commit comments