Skip to content

Commit b86d456

Browse files
SimonSiefkesindresorhus
authored andcommitted
Don't use non-standard AST property in no-for-loop rule (#279)
Fixes #272
1 parent 0765c1f commit b86d456

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rules/no-for-loop.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ const checkUpdateExpression = (forStatement, indexIdentifierName) => {
168168

169169
const getRemovalRange = (node, sourceCode) => {
170170
const nodeText = sourceCode.getText(node);
171-
const {line} = sourceCode.getLocFromIndex(node.start);
171+
const {line} = sourceCode.getLocFromIndex(node.range[0]);
172172
const lineText = sourceCode.lines[line - 1];
173173

174174
const isOnlyNodeOnItsLine = lineText.trim() === nodeText;

0 commit comments

Comments
 (0)