@@ -107,73 +107,84 @@ ruleTester.run('self-closing-comp', rule, {
107
107
invalid : [
108
108
{
109
109
code : 'var contentContainer = <div className="content"></div>;' ,
110
+ output : 'var contentContainer = <div className="content" />;' ,
110
111
parserOptions : parserOptions ,
111
112
errors : [ {
112
113
message : 'Empty components are self-closing'
113
114
} ]
114
115
} , {
115
116
code : 'var contentContainer = <div className="content"></div>;' ,
117
+ output : 'var contentContainer = <div className="content" />;' ,
116
118
options : [ ] ,
117
119
parserOptions : parserOptions ,
118
120
errors : [ {
119
121
message : 'Empty components are self-closing'
120
122
} ]
121
123
} , {
122
124
code : 'var HelloJohn = <Hello name="John"></Hello>;' ,
125
+ output : 'var HelloJohn = <Hello name="John" />;' ,
123
126
parserOptions : parserOptions ,
124
127
errors : [ {
125
128
message : 'Empty components are self-closing'
126
129
} ]
127
130
} , {
128
131
code : 'var HelloJohn = <Hello name="John">\n</Hello>;' ,
132
+ output : 'var HelloJohn = <Hello name="John" />;' ,
129
133
parserOptions : parserOptions ,
130
134
errors : [ {
131
135
message : 'Empty components are self-closing'
132
136
} ]
133
137
} , {
134
138
code : 'var HelloJohn = <Hello name="John"> </Hello>;' ,
139
+ output : 'var HelloJohn = <Hello name="John" />;' ,
135
140
parserOptions : parserOptions ,
136
141
errors : [ {
137
142
message : 'Empty components are self-closing'
138
143
} ]
139
144
} ,
140
145
{
141
146
code : 'var HelloJohn = <Hello name="John"></Hello>;' ,
147
+ output : 'var HelloJohn = <Hello name="John" />;' ,
142
148
options : [ ] ,
143
149
parserOptions : parserOptions ,
144
150
errors : [ {
145
151
message : 'Empty components are self-closing'
146
152
} ]
147
153
} , {
148
154
code : 'var HelloJohn = <Hello name="John">\n</Hello>;' ,
155
+ output : 'var HelloJohn = <Hello name="John" />;' ,
149
156
options : [ ] ,
150
157
parserOptions : parserOptions ,
151
158
errors : [ {
152
159
message : 'Empty components are self-closing'
153
160
} ]
154
161
} , {
155
162
code : 'var HelloJohn = <Hello name="John"> </Hello>;' ,
163
+ output : 'var HelloJohn = <Hello name="John" />;' ,
156
164
options : [ ] ,
157
165
parserOptions : parserOptions ,
158
166
errors : [ {
159
167
message : 'Empty components are self-closing'
160
168
} ]
161
169
} , {
162
170
code : 'var contentContainer = <div className="content"></div>;' ,
171
+ output : 'var contentContainer = <div className="content" />;' ,
163
172
options : [ { html : true } ] ,
164
173
parserOptions : parserOptions ,
165
174
errors : [ {
166
175
message : 'Empty components are self-closing'
167
176
} ]
168
177
} , {
169
178
code : 'var contentContainer = <div className="content">\n</div>;' ,
179
+ output : 'var contentContainer = <div className="content" />;' ,
170
180
options : [ { html : true } ] ,
171
181
parserOptions : parserOptions ,
172
182
errors : [ {
173
183
message : 'Empty components are self-closing'
174
184
} ]
175
185
} , {
176
186
code : 'var contentContainer = <div className="content"> </div>;' ,
187
+ output : 'var contentContainer = <div className="content" />;' ,
177
188
options : [ { html : true } ] ,
178
189
parserOptions : parserOptions ,
179
190
errors : [ {
0 commit comments