Skip to content

Commit 83e24f5

Browse files
authored
docs: Replace var with let or const (#19511)
* chore: update no-unreachable * chore: update rule no-unreachable-loop * remove const- unecessary * add let * doc: replace var back in no-unreachable. with as written, breaks otherwise.
1 parent a59d0c0 commit 83e24f5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/src/rules/no-unreachable-loop.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ function verifyList(head) {
5656
}
5757

5858
function findSomething(arr) {
59-
for (var i = 0; i < arr.length; i++) {
59+
for (let i = 0; i < arr.length; i++) {
6060
if (isSomething(arr[i])) {
6161
return arr[i];
6262
} else {
@@ -110,7 +110,7 @@ function verifyList(head) {
110110
}
111111

112112
function findSomething(arr) {
113-
for (var i = 0; i < arr.length; i++) {
113+
for (let i = 0; i < arr.length; i++) {
114114
if (isSomething(arr[i])) {
115115
return arr[i];
116116
}
@@ -184,7 +184,7 @@ Examples of **correct** code for this rule with the `"ignore"` option:
184184
```js
185185
/*eslint no-unreachable-loop: ["error", { "ignore": ["ForInStatement", "ForOfStatement"] }]*/
186186

187-
for (var key in obj) {
187+
for (let key in obj) {
188188
hasEnumerableProperties = true;
189189
break;
190190
}

0 commit comments

Comments
 (0)