Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 83e24f5

Browse filesBrowse 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
Copy full SHA for 83e24f5

File tree

Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed

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

Copy file name to clipboardExpand all lines: docs/src/rules/no-unreachable-loop.md
+3-3Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.