Skip to content

Commit aa4c339

Browse files
author
Josh Eckhoff
committed
Use range[1] instead of end, as it has wider parser support.
1 parent 24044e0 commit aa4c339

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/rules/jsx-first-prop-new-line.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ module.exports = {
4545
node: decl,
4646
message: 'Property should be placed on a new line',
4747
fix: function(fixer) {
48-
return fixer.replaceTextRange([node.name.end, decl.range[0]], '\n');
48+
return fixer.replaceTextRange([node.name.range[1], decl.range[0]], '\n');
4949
}
5050
});
5151
}
@@ -58,7 +58,7 @@ module.exports = {
5858
node: firstNode,
5959
message: 'Property should be placed on the same line as the component declaration',
6060
fix: function(fixer) {
61-
return fixer.replaceTextRange([node.name.end, firstNode.range[0]], ' ');
61+
return fixer.replaceTextRange([node.name.range[1], firstNode.range[0]], ' ');
6262
}
6363
});
6464
return;

0 commit comments

Comments
 (0)