diff --git a/lib/rules/jsx-curly-spacing.js b/lib/rules/jsx-curly-spacing.js index a53f24a740..b587d2fe52 100644 --- a/lib/rules/jsx-curly-spacing.js +++ b/lib/rules/jsx-curly-spacing.js @@ -244,7 +244,7 @@ module.exports = { // Take comments into consideration to narrow the fix range to what is actually affected. (See #1414) if (nextComment.length > 0) { - return fixByTrimmingWhitespace(fixer, token.range[1], Math.min(nextToken.range[0], nextComment[0].start), 'start'); + return fixByTrimmingWhitespace(fixer, token.range[1], Math.min(nextToken.range[0], nextComment[0].range[0]), 'start'); } return fixByTrimmingWhitespace(fixer, token.range[1], nextToken.range[0], 'start'); @@ -279,7 +279,7 @@ module.exports = { // Take comments into consideration to narrow the fix range to what is actually affected. (See #1414) if (previousComment.length > 0) { - return fixByTrimmingWhitespace(fixer, Math.max(previousToken.range[1], previousComment[0].end), token.range[0], 'end'); + return fixByTrimmingWhitespace(fixer, Math.max(previousToken.range[1], previousComment[0].range[1]), token.range[0], 'end'); } return fixByTrimmingWhitespace(fixer, previousToken.range[1], token.range[0], 'end'); diff --git a/lib/rules/jsx-no-bind.js b/lib/rules/jsx-no-bind.js index 612f492cea..35f1c8a2d3 100644 --- a/lib/rules/jsx-no-bind.js +++ b/lib/rules/jsx-no-bind.js @@ -132,13 +132,13 @@ module.exports = { function findVariableViolation(node, name) { getBlockStatementAncestors(node).find( - block => reportVariableViolation(node, name, block.start) + block => reportVariableViolation(node, name, block.range[0]) ); } return { BlockStatement(node) { - setBlockVariableNameSet(node.start); + setBlockVariableNameSet(node.range[0]); }, VariableDeclarator(node) { @@ -154,7 +154,7 @@ module.exports = { node.parent.kind === 'const' // only support const right now ) { addVariableNameToSet( - variableViolationType, node.id.name, blockAncestors[0].start + variableViolationType, node.id.name, blockAncestors[0].range[0] ); } }, diff --git a/lib/util/usedPropTypes.js b/lib/util/usedPropTypes.js index f1ac14622c..ab0c188f32 100755 --- a/lib/util/usedPropTypes.js +++ b/lib/util/usedPropTypes.js @@ -170,7 +170,7 @@ function isPropArgumentInSetStateUpdater(context, name) { unwrappedParentCalleeNode.property && unwrappedParentCalleeNode.property.name === 'setState' && // Make sure we are in the updater not the callback - scope.block.parent.arguments[0].start === scope.block.start && + scope.block.parent.arguments[0].range[0] === scope.block.range[0] && scope.block.parent.arguments[0].params && scope.block.parent.arguments[0].params.length > 1 ) {