@@ -129,6 +129,17 @@ ruleTester.run('jsx-first-prop-new-line', rule, {
129129 options : [ 'multiline-multiprop' ] ,
130130 parser : 'babel-eslint'
131131 } ,
132+ {
133+ code : [
134+ '<Foo ' ,
135+ ' foo={{' ,
136+ ' }}' ,
137+ ' bar' ,
138+ '/>'
139+ ] . join ( '\n' ) ,
140+ options : [ 'multiline-multiprop' ] ,
141+ parser : 'typescript-eslint-parser'
142+ } ,
132143 {
133144 code : '<Foo />' ,
134145 options : [ 'always' ] ,
@@ -167,6 +178,16 @@ ruleTester.run('jsx-first-prop-new-line', rule, {
167178 errors : [ { message : 'Property should be placed on a new line' } ] ,
168179 parser : 'babel-eslint'
169180 } ,
181+ {
182+ code : '<Foo propOne="one" propTwo="two" />' ,
183+ output : [
184+ '<Foo' ,
185+ 'propOne="one" propTwo="two" />'
186+ ] . join ( '\n' ) ,
187+ options : [ 'always' ] ,
188+ errors : [ { message : 'Property should be placed on a new line' } ] ,
189+ parser : 'typescript-eslint-parser'
190+ } ,
170191 {
171192 code : [
172193 '<Foo propOne="one"' ,
@@ -183,6 +204,22 @@ ruleTester.run('jsx-first-prop-new-line', rule, {
183204 errors : [ { message : 'Property should be placed on a new line' } ] ,
184205 parser : 'babel-eslint'
185206 } ,
207+ {
208+ code : [
209+ '<Foo propOne="one"' ,
210+ ' propTwo="two"' ,
211+ '/>'
212+ ] . join ( '\n' ) ,
213+ output : [
214+ '<Foo' ,
215+ 'propOne="one"' ,
216+ ' propTwo="two"' ,
217+ '/>'
218+ ] . join ( '\n' ) ,
219+ options : [ 'always' ] ,
220+ errors : [ { message : 'Property should be placed on a new line' } ] ,
221+ parser : 'typescript-eslint-parser'
222+ } ,
186223 {
187224 code : [
188225 '<Foo' ,
@@ -199,6 +236,22 @@ ruleTester.run('jsx-first-prop-new-line', rule, {
199236 errors : [ { message : 'Property should be placed on the same line as the component declaration' } ] ,
200237 parser : 'babel-eslint'
201238 } ,
239+ {
240+ code : [
241+ '<Foo' ,
242+ ' propOne="one"' ,
243+ ' propTwo="two"' ,
244+ '/>'
245+ ] . join ( '\n' ) ,
246+ output : [
247+ '<Foo propOne="one"' ,
248+ ' propTwo="two"' ,
249+ '/>'
250+ ] . join ( '\n' ) ,
251+ options : [ 'never' ] ,
252+ errors : [ { message : 'Property should be placed on the same line as the component declaration' } ] ,
253+ parser : 'typescript-eslint-parser'
254+ } ,
202255 {
203256 code : [
204257 '<Foo prop={{' ,
@@ -213,6 +266,20 @@ ruleTester.run('jsx-first-prop-new-line', rule, {
213266 errors : [ { message : 'Property should be placed on a new line' } ] ,
214267 parser : 'babel-eslint'
215268 } ,
269+ {
270+ code : [
271+ '<Foo prop={{' ,
272+ '}} />'
273+ ] . join ( '\n' ) ,
274+ output : [
275+ '<Foo' ,
276+ 'prop={{' ,
277+ '}} />'
278+ ] . join ( '\n' ) ,
279+ options : [ 'multiline' ] ,
280+ errors : [ { message : 'Property should be placed on a new line' } ] ,
281+ parser : 'typescript-eslint-parser'
282+ } ,
216283 {
217284 code : [
218285 '<Foo bar={{' ,
@@ -226,6 +293,20 @@ ruleTester.run('jsx-first-prop-new-line', rule, {
226293 options : [ 'multiline-multiprop' ] ,
227294 errors : [ { message : 'Property should be placed on a new line' } ] ,
228295 parser : 'babel-eslint'
296+ } ,
297+ {
298+ code : [
299+ '<Foo bar={{' ,
300+ '}} baz />'
301+ ] . join ( '\n' ) ,
302+ output : [
303+ '<Foo' ,
304+ 'bar={{' ,
305+ '}} baz />'
306+ ] . join ( '\n' ) ,
307+ options : [ 'multiline-multiprop' ] ,
308+ errors : [ { message : 'Property should be placed on a new line' } ] ,
309+ parser : 'typescript-eslint-parser'
229310 }
230311 ]
231312} ) ;
0 commit comments