@@ -42,18 +42,45 @@ ruleTester.run("dot-location", rule, {
4242 invalid : [
4343 {
4444 code : "obj\n.property" ,
45+ output : "obj.\nproperty" ,
4546 options : [ "object" ] ,
4647 errors : [ { message : "Expected dot to be on same line as object." , type : "MemberExpression" , line : 2 , column : 1 } ]
4748 } ,
4849 {
4950 code : "obj.\nproperty" ,
51+ output : "obj\n.property" ,
5052 options : [ "property" ] ,
5153 errors : [ { message : "Expected dot to be on same line as property." , type : "MemberExpression" , line : 1 , column : 4 } ]
5254 } ,
5355 {
5456 code : "(obj).\nproperty" ,
57+ output : "(obj)\n.property" ,
5558 options : [ "property" ] ,
5659 errors : [ { message : "Expected dot to be on same line as property." , type : "MemberExpression" , line : 1 , column : 6 } ]
60+ } ,
61+ {
62+ code : "5\n.toExponential()" ,
63+ output : "5 .\ntoExponential()" ,
64+ options : [ "object" ] ,
65+ errors : [ { message : "Expected dot to be on same line as object." , type : "MemberExpression" , line : 2 , column : 1 } ]
66+ } ,
67+ {
68+ code : "-5\n.toExponential()" ,
69+ output : "-5 .\ntoExponential()" ,
70+ options : [ "object" ] ,
71+ errors : [ { message : "Expected dot to be on same line as object." , type : "MemberExpression" , line : 2 , column : 1 } ]
72+ } ,
73+ {
74+ code : "foo /* a */ . /* b */ \n /* c */ bar" ,
75+ output : "foo /* a */ /* b */ \n /* c */ .bar" ,
76+ options : [ "property" ] ,
77+ errors : [ { message : "Expected dot to be on same line as property." , type : "MemberExpression" , line : 1 , column : 13 } ]
78+ } ,
79+ {
80+ code : "foo /* a */ \n /* b */ . /* c */ bar" ,
81+ output : "foo. /* a */ \n /* b */ /* c */ bar" ,
82+ options : [ "object" ] ,
83+ errors : [ { message : "Expected dot to be on same line as object." , type : "MemberExpression" , line : 2 , column : 10 } ]
5784 }
5885 ]
5986} ) ;
0 commit comments