@@ -232,7 +232,7 @@ module.exports = {
232
232
233
233
'JSXOpeningElement:exit' : function ( node ) {
234
234
const attributeNode = lastAttributeNode [ getOpeningElementId ( node ) ] ;
235
- const cachedLastAttributeEndPos = attributeNode ? attributeNode . end : null ;
235
+ const cachedLastAttributeEndPos = attributeNode ? attributeNode . range [ 1 ] : null ;
236
236
let expectedNextLine ;
237
237
const tokens = getTokensLocations ( node ) ;
238
238
const expectedLocation = getExpectedLocation ( tokens ) ;
@@ -260,18 +260,18 @@ module.exports = {
260
260
switch ( expectedLocation ) {
261
261
case 'after-tag' :
262
262
if ( cachedLastAttributeEndPos ) {
263
- return fixer . replaceTextRange ( [ cachedLastAttributeEndPos , node . end ] ,
263
+ return fixer . replaceTextRange ( [ cachedLastAttributeEndPos , node . range [ 1 ] ] ,
264
264
( expectedNextLine ? '\n' : '' ) + closingTag ) ;
265
265
}
266
- return fixer . replaceTextRange ( [ node . name . range [ 1 ] , node . end ] ,
266
+ return fixer . replaceTextRange ( [ node . name . range [ 1 ] , node . range [ 1 ] ] ,
267
267
( expectedNextLine ? '\n' : ' ' ) + closingTag ) ;
268
268
case 'after-props' :
269
- return fixer . replaceTextRange ( [ cachedLastAttributeEndPos , node . end ] ,
269
+ return fixer . replaceTextRange ( [ cachedLastAttributeEndPos , node . range [ 1 ] ] ,
270
270
( expectedNextLine ? '\n' : '' ) + closingTag ) ;
271
271
case 'props-aligned' :
272
272
case 'tag-aligned' :
273
273
case 'line-aligned' :
274
- return fixer . replaceTextRange ( [ cachedLastAttributeEndPos , node . end ] ,
274
+ return fixer . replaceTextRange ( [ cachedLastAttributeEndPos , node . range [ 1 ] ] ,
275
275
`\n${ getIndentation ( tokens , expectedLocation , correctColumn ) } ${ closingTag } ` ) ;
276
276
default :
277
277
return true ;
0 commit comments