@@ -90,8 +90,12 @@ module.exports = class Prettier extends Rule {
9090
9191 this . log ( {
9292 message,
93+ // As of [email protected] , passing line and column whose values match the 94+ // reference node's line and column isn't required (it uses the node's line/column).
95+ // In order to support older versions (> 3.8.0), we're keeping these properties here.
9396 line : node . loc && node . loc . start . line ,
9497 column : node . loc && node . loc . start . column ,
98+ node,
9599 source,
96100 } ) ;
97101
@@ -108,8 +112,12 @@ module.exports = class Prettier extends Rule {
108112
109113 differences . forEach ( ( difference ) => {
110114 let message = "" ;
111- let { line, column } = getLocFromIndex (
112- difference . offset ,
115+ // `difference.offset` is the offset from the beginning
116+ // of the template, ie. it is the index
117+ let { offset, deleteText = "" } = difference ;
118+ let { line, column } = getLocFromIndex ( offset , this . source ) ;
119+ let { line : endLine , column : endColumn } = getLocFromIndex (
120+ offset + deleteText . length ,
113121 this . source
114122 ) ;
115123
@@ -131,7 +139,15 @@ module.exports = class Prettier extends Rule {
131139 break ;
132140 }
133141
134- this . log ( { message, line, column, source, isFixable : true } ) ;
142+ this . log ( {
143+ message,
144+ line,
145+ column,
146+ endLine,
147+ endColumn,
148+ source,
149+ isFixable : true ,
150+ } ) ;
135151 } ) ;
136152 }
137153 } ,
0 commit comments