-
-
Notifications
You must be signed in to change notification settings - Fork 5k
prefer-const barks at looping variables #4088
Copy link
Copy link
Closed
Labels
archived due to ageThis issue has been archived; please open a new issue for any further discussionThis issue has been archived; please open a new issue for any further discussiontriageAn ESLint team member will look at this issue soonAn ESLint team member will look at this issue soon
Metadata
Metadata
Assignees
Labels
archived due to ageThis issue has been archived; please open a new issue for any further discussionThis issue has been archived; please open a new issue for any further discussiontriageAn ESLint team member will look at this issue soonAn ESLint team member will look at this issue soon
Let's say if I have code like this
enabling
prefer-construle errors out saying,errorais never modified, useconstinstead prefer-const. But if we change thatlettoconst, the value will never change in the loop. Note that this happens only in sloppy and strong mode. In strict modeconstworks fine. (All these are tested with Node.js v4.1.2).Is it really safe/okay to suggest changing loop variable to
const?Related: nodejs/node#3152 (comment)
ESLint version: 0.24.0