@@ -40,6 +40,8 @@ module.exports = function(context) {
4040 var indentType = 'space' ;
4141 var indentSize = 4 ;
4242
43+ var sourceCode = context . getSourceCode ( ) ;
44+
4345 if ( context . options . length ) {
4446 if ( context . options [ 0 ] === 'tab' ) {
4547 indentSize = 1 ;
@@ -66,9 +68,18 @@ module.exports = function(context) {
6668 } ;
6769
6870 if ( loc ) {
69- context . report ( node , loc , MESSAGE , msgContext ) ;
71+ context . report ( {
72+ node : node ,
73+ loc : loc ,
74+ message : MESSAGE ,
75+ data : msgContext
76+ } ) ;
7077 } else {
71- context . report ( node , MESSAGE , msgContext ) ;
78+ context . report ( {
79+ node : node ,
80+ message : MESSAGE ,
81+ data : msgContext
82+ } ) ;
7283 }
7384 }
7485
@@ -83,7 +94,7 @@ module.exports = function(context) {
8394 byLastLine = byLastLine || false ;
8495 excludeCommas = excludeCommas || false ;
8596
86- var src = context . getSource ( node , node . loc . start . column + extraColumnStart ) ;
97+ var src = sourceCode . getText ( node , node . loc . start . column + extraColumnStart ) ;
8798 var lines = src . split ( '\n' ) ;
8899 if ( byLastLine ) {
89100 src = lines [ lines . length - 1 ] ;
@@ -111,7 +122,7 @@ module.exports = function(context) {
111122 * @return {Boolean } true if its the first in the its start line
112123 */
113124 function isNodeFirstInLine ( node , byEndLocation ) {
114- var firstToken = byEndLocation === true ? context . getLastToken ( node , 1 ) : context . getTokenBefore ( node ) ;
125+ var firstToken = byEndLocation === true ? sourceCode . getLastToken ( node , 1 ) : sourceCode . getTokenBefore ( node ) ;
115126 var startLine = byEndLocation === true ? node . loc . end . line : node . loc . start . line ;
116127 var endLine = firstToken ? firstToken . loc . end . line : - 1 ;
117128
0 commit comments