@@ -31,6 +31,8 @@ ruleTester.run("eqeqeq", rule, {
3131 { code : "typeof a == 'number'" , options : [ "smart" ] } ,
3232 { code : "'string' != typeof a" , options : [ "smart" ] } ,
3333 { code : "'hello' != 'world'" , options : [ "smart" ] } ,
34+ { code : "`hello` != `world`" , options : [ "smart" ] } ,
35+ { code : "`hello` == 'hello'" , options : [ "smart" ] } ,
3436 { code : "2 == 3" , options : [ "smart" ] } ,
3537 { code : "true == true" , options : [ "smart" ] } ,
3638 { code : "null == a" , options : [ "smart" ] } ,
@@ -183,6 +185,26 @@ ruleTester.run("eqeqeq", rule, {
183185 } ,
184186 ] ,
185187 } ,
188+ {
189+ code : "`hello` == `world`" ,
190+ output : "`hello` === `world`" ,
191+ errors : [
192+ {
193+ messageId : "unexpected" ,
194+ data : wantedEqEqEq ,
195+ } ,
196+ ] ,
197+ } ,
198+ {
199+ code : "`hello` != 'world'" ,
200+ output : "`hello` !== 'world'" ,
201+ errors : [
202+ {
203+ messageId : "unexpected" ,
204+ data : wantedNotEqEq ,
205+ } ,
206+ ] ,
207+ } ,
186208 {
187209 code : "a == null" ,
188210 errors : [
@@ -283,6 +305,23 @@ ruleTester.run("eqeqeq", rule, {
283305 } ,
284306 ] ,
285307 } ,
308+ {
309+ code : "`hello${world}` == `hello`" ,
310+ options : [ "smart" ] ,
311+ errors : [
312+ {
313+ messageId : "unexpected" ,
314+ data : wantedEqEqEq ,
315+ suggestions : [
316+ {
317+ messageId : "replaceOperator" ,
318+ data : wantedEqEqEq ,
319+ output : "`hello${world}` === `hello`" ,
320+ } ,
321+ ] ,
322+ } ,
323+ ] ,
324+ } ,
286325 {
287326 code : "typeof a == 'number'" ,
288327 output : "typeof a === 'number'" ,
0 commit comments