Skip to content

Commit

Permalink
Use range[1] instead of end, as it has wider parser support.
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh Eckhoff committed Oct 24, 2018
1 parent 24044e0 commit aa4c339
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/rules/jsx-first-prop-new-line.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ module.exports = {
node: decl,
message: 'Property should be placed on a new line',
fix: function(fixer) {
return fixer.replaceTextRange([node.name.end, decl.range[0]], '\n');
return fixer.replaceTextRange([node.name.range[1], decl.range[0]], '\n');
}
});
}
Expand All @@ -58,7 +58,7 @@ module.exports = {
node: firstNode,
message: 'Property should be placed on the same line as the component declaration',
fix: function(fixer) {
return fixer.replaceTextRange([node.name.end, firstNode.range[0]], ' ');
return fixer.replaceTextRange([node.name.range[1], firstNode.range[0]], ' ');
}
});
return;
Expand Down

0 comments on commit aa4c339

Please sign in to comment.