@@ -30,37 +30,66 @@ ruleTester.run('self-closing-comp', rule, {
30
30
valid : [
31
31
{
32
32
code : 'var HelloJohn = <Hello name="John" />;'
33
+ } , {
34
+ code : 'var HelloJohn = <Hello.Compound name="John" />;'
33
35
} , {
34
36
code : 'var Profile = <Hello name="John"><img src="picture.png" /></Hello>;'
37
+ } , {
38
+ code : 'var Profile = <Hello.Compound name="John"><img src="picture.png" /></Hello.Compound>;'
35
39
} , {
36
40
code : `
37
41
<Hello>
38
42
<Hello name="John" />
39
43
</Hello>
40
44
`
45
+ } , {
46
+ code : `
47
+ <Hello.Compound>
48
+ <Hello.Compound name="John" />
49
+ </Hello.Compound>
50
+ `
41
51
} , {
42
52
code : 'var HelloJohn = <Hello name="John"> </Hello>;'
53
+ } , {
54
+ code : 'var HelloJohn = <Hello.Compound name="John"> </Hello.Compound>;'
43
55
} , {
44
56
code : 'var HelloJohn = <Hello name="John"> </Hello>;'
57
+ } , {
58
+ code : 'var HelloJohn = <Hello.Compound name="John"> </Hello.Compound>;'
45
59
} , {
46
60
code : 'var HelloJohn = <div> </div>;'
47
61
} , {
48
62
code : 'var HelloJohn = <div>{\' \'}</div>;'
49
63
} , {
50
64
code : 'var HelloJohn = <Hello name="John"> </Hello>;'
65
+ } , {
66
+ code : 'var HelloJohn = <Hello.Compound name="John"> </Hello.Compound>;'
51
67
} , {
52
68
code : 'var HelloJohn = <Hello name="John" />;' ,
53
69
options : [ ]
70
+ } , {
71
+ code : 'var HelloJohn = <Hello.Compound name="John" />;' ,
72
+ options : [ ]
54
73
} , {
55
74
code : 'var Profile = <Hello name="John"><img src="picture.png" /></Hello>;' ,
56
75
options : [ ]
76
+ } , {
77
+ code : 'var Profile = <Hello.Compound name="John"><img src="picture.png" /></Hello.Compound>;' ,
78
+ options : [ ]
57
79
} , {
58
80
code : `
59
81
<Hello>
60
82
<Hello name="John" />
61
83
</Hello>
62
84
` ,
63
85
options : [ ]
86
+ } , {
87
+ code : `
88
+ <Hello.Compound>
89
+ <Hello.Compound name="John" />
90
+ </Hello.Compound>
91
+ ` ,
92
+ options : [ ]
64
93
} , {
65
94
code : 'var HelloJohn = <div> </div>;' ,
66
95
options : [ ]
@@ -76,15 +105,27 @@ ruleTester.run('self-closing-comp', rule, {
76
105
} , {
77
106
code : 'var HelloJohn = <Hello name="John"> </Hello>;' ,
78
107
options : [ ]
108
+ } , {
109
+ code : 'var HelloJohn = <Hello.Compound name="John"> </Hello.Compound>;' ,
110
+ options : [ ]
79
111
} , {
80
112
code : 'var HelloJohn = <Hello name="John"></Hello>;' ,
81
113
options : [ { component : false } ]
114
+ } , {
115
+ code : 'var HelloJohn = <Hello.Compound name="John"></Hello.Compound>;' ,
116
+ options : [ { component : false } ]
82
117
} , {
83
118
code : 'var HelloJohn = <Hello name="John">\n</Hello>;' ,
84
119
options : [ { component : false } ]
120
+ } , {
121
+ code : 'var HelloJohn = <Hello.Compound name="John">\n</Hello.Compound>;' ,
122
+ options : [ { component : false } ]
85
123
} , {
86
124
code : 'var HelloJohn = <Hello name="John"> </Hello>;' ,
87
125
options : [ { component : false } ]
126
+ } , {
127
+ code : 'var HelloJohn = <Hello.Compound name="John"> </Hello.Compound>;' ,
128
+ options : [ { component : false } ]
88
129
} , {
89
130
code : 'var contentContainer = <div className="content" />;' ,
90
131
options : [ { html : true } ]
@@ -121,26 +162,52 @@ ruleTester.run('self-closing-comp', rule, {
121
162
errors : [ {
122
163
message : 'Empty components are self-closing'
123
164
} ]
165
+ } , {
166
+ code : 'var CompoundHelloJohn = <Hello.Compound name="John"></Hello.Compound>;' ,
167
+ output : 'var CompoundHelloJohn = <Hello.Compound name="John" />;' ,
168
+ errors : [ {
169
+ message : 'Empty components are self-closing'
170
+ } ]
124
171
} , {
125
172
code : 'var HelloJohn = <Hello name="John">\n</Hello>;' ,
126
173
output : 'var HelloJohn = <Hello name="John" />;' ,
127
174
errors : [ {
128
175
message : 'Empty components are self-closing'
129
176
} ]
177
+ } , {
178
+ code : 'var HelloJohn = <Hello.Compound name="John">\n</Hello.Compound>;' ,
179
+ output : 'var HelloJohn = <Hello.Compound name="John" />;' ,
180
+ errors : [ {
181
+ message : 'Empty components are self-closing'
182
+ } ]
130
183
} , {
131
184
code : 'var HelloJohn = <Hello name="John"></Hello>;' ,
132
185
output : 'var HelloJohn = <Hello name="John" />;' ,
133
186
options : [ ] ,
134
187
errors : [ {
135
188
message : 'Empty components are self-closing'
136
189
} ]
190
+ } , {
191
+ code : 'var HelloJohn = <Hello.Compound name="John"></Hello.Compound>;' ,
192
+ output : 'var HelloJohn = <Hello.Compound name="John" />;' ,
193
+ options : [ ] ,
194
+ errors : [ {
195
+ message : 'Empty components are self-closing'
196
+ } ]
137
197
} , {
138
198
code : 'var HelloJohn = <Hello name="John">\n</Hello>;' ,
139
199
output : 'var HelloJohn = <Hello name="John" />;' ,
140
200
options : [ ] ,
141
201
errors : [ {
142
202
message : 'Empty components are self-closing'
143
203
} ]
204
+ } , {
205
+ code : 'var HelloJohn = <Hello.Compound name="John">\n</Hello.Compound>;' ,
206
+ output : 'var HelloJohn = <Hello.Compound name="John" />;' ,
207
+ options : [ ] ,
208
+ errors : [ {
209
+ message : 'Empty components are self-closing'
210
+ } ]
144
211
} , {
145
212
code : 'var contentContainer = <div className="content"></div>;' ,
146
213
output : 'var contentContainer = <div className="content" />;' ,
0 commit comments