@@ -232,7 +232,7 @@ module.exports = {
232232
233233 'JSXOpeningElement:exit' : function ( node ) {
234234 const attributeNode = lastAttributeNode [ getOpeningElementId ( node ) ] ;
235- const cachedLastAttributeEndPos = attributeNode ? attributeNode . end : null ;
235+ const cachedLastAttributeEndPos = attributeNode ? attributeNode . range [ 1 ] : null ;
236236 let expectedNextLine ;
237237 const tokens = getTokensLocations ( node ) ;
238238 const expectedLocation = getExpectedLocation ( tokens ) ;
@@ -260,18 +260,18 @@ module.exports = {
260260 switch ( expectedLocation ) {
261261 case 'after-tag' :
262262 if ( cachedLastAttributeEndPos ) {
263- return fixer . replaceTextRange ( [ cachedLastAttributeEndPos , node . end ] ,
263+ return fixer . replaceTextRange ( [ cachedLastAttributeEndPos , node . range [ 1 ] ] ,
264264 ( expectedNextLine ? '\n' : '' ) + closingTag ) ;
265265 }
266- return fixer . replaceTextRange ( [ node . name . range [ 1 ] , node . end ] ,
266+ return fixer . replaceTextRange ( [ node . name . range [ 1 ] , node . range [ 1 ] ] ,
267267 ( expectedNextLine ? '\n' : ' ' ) + closingTag ) ;
268268 case 'after-props' :
269- return fixer . replaceTextRange ( [ cachedLastAttributeEndPos , node . end ] ,
269+ return fixer . replaceTextRange ( [ cachedLastAttributeEndPos , node . range [ 1 ] ] ,
270270 ( expectedNextLine ? '\n' : '' ) + closingTag ) ;
271271 case 'props-aligned' :
272272 case 'tag-aligned' :
273273 case 'line-aligned' :
274- return fixer . replaceTextRange ( [ cachedLastAttributeEndPos , node . end ] ,
274+ return fixer . replaceTextRange ( [ cachedLastAttributeEndPos , node . range [ 1 ] ] ,
275275 `\n${ getIndentation ( tokens , expectedLocation , correctColumn ) } ${ closingTag } ` ) ;
276276 default :
277277 return true ;
0 commit comments