@@ -2148,6 +2148,40 @@ ruleTester.run('jsx-curly-spacing', rule, {
2148
2148
} , {
2149
2149
message : 'A space is required before \'}\''
2150
2150
} ]
2151
+ } , {
2152
+ code : [
2153
+ '<App>' ,
2154
+ '{ /* comment */ }' ,
2155
+ '</App>;'
2156
+ ] . join ( '\n' ) ,
2157
+ output : [
2158
+ '<App>' ,
2159
+ '{/* comment */}' ,
2160
+ '</App>;'
2161
+ ] . join ( '\n' ) ,
2162
+ options : [ { when : 'never' , children : true } ] ,
2163
+ errors : [ {
2164
+ message : 'There should be no space after \'{\''
2165
+ } , {
2166
+ message : 'There should be no space before \'}\''
2167
+ } ]
2168
+ } , {
2169
+ code : [
2170
+ '<App>' ,
2171
+ '{/* comment */}' ,
2172
+ '</App>;'
2173
+ ] . join ( '\n' ) ,
2174
+ output : [
2175
+ '<App>' ,
2176
+ '{ /* comment */ }' ,
2177
+ '</App>;'
2178
+ ] . join ( '\n' ) ,
2179
+ options : [ { when : 'always' , children : true } ] ,
2180
+ errors : [ {
2181
+ message : 'A space is required after \'{\''
2182
+ } , {
2183
+ message : 'A space is required before \'}\''
2184
+ } ]
2151
2185
} , {
2152
2186
code : [
2153
2187
'<App>' ,
@@ -2180,5 +2214,47 @@ ruleTester.run('jsx-curly-spacing', rule, {
2180
2214
errors : [ {
2181
2215
message : 'There should be no newline after \'{\''
2182
2216
} ]
2217
+ } , {
2218
+ code : [
2219
+ '<App>{ /* comment */' ,
2220
+ 'bar' ,
2221
+ '} {' ,
2222
+ 'baz' ,
2223
+ '/* comment */ }</App>;'
2224
+ ] . join ( '\n' ) ,
2225
+ output : [
2226
+ '<App>{/* comment */' ,
2227
+ 'bar' ,
2228
+ '} {' ,
2229
+ 'baz' ,
2230
+ '/* comment */}</App>;'
2231
+ ] . join ( '\n' ) ,
2232
+ options : [ { when : 'never' , children : true } ] ,
2233
+ errors : [ {
2234
+ message : 'There should be no space after \'{\''
2235
+ } , {
2236
+ message : 'There should be no space before \'}\''
2237
+ } ]
2238
+ } , {
2239
+ code : [
2240
+ '<App>{/* comment */' ,
2241
+ 'bar' ,
2242
+ '} {' ,
2243
+ 'baz' ,
2244
+ '/* comment */}</App>;'
2245
+ ] . join ( '\n' ) ,
2246
+ output : [
2247
+ '<App>{ /* comment */' ,
2248
+ 'bar' ,
2249
+ '} {' ,
2250
+ 'baz' ,
2251
+ '/* comment */ }</App>;'
2252
+ ] . join ( '\n' ) ,
2253
+ options : [ { when : 'always' , children : true } ] ,
2254
+ errors : [ {
2255
+ message : 'A space is required after \'{\''
2256
+ } , {
2257
+ message : 'A space is required before \'}\''
2258
+ } ]
2183
2259
} ]
2184
2260
} ) ;
0 commit comments