Skip to content

Commit 2f7af03

Browse files
committed
Update let variables to const
1 parent f2495f5 commit 2f7af03

File tree

1 file changed

+60
-60
lines changed

1 file changed

+60
-60
lines changed

docs/src/rules/array-bracket-newline.md

Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ Examples of **incorrect** code for this rule with the `"always"` option:
3535
```js
3636
/*eslint array-bracket-newline: ["error", "always"]*/
3737

38-
let a = [];
39-
let b = [1];
40-
let c = [1, 2];
41-
let d = [1,
38+
const a = [];
39+
const b = [1];
40+
const c = [1, 2];
41+
const d = [1,
4242
2];
43-
let e = [function foo() {
43+
const e = [function foo() {
4444
dosomething();
4545
}];
4646
```
@@ -54,19 +54,19 @@ Examples of **correct** code for this rule with the `"always"` option:
5454
```js
5555
/*eslint array-bracket-newline: ["error", "always"]*/
5656

57-
let a = [
57+
const a = [
5858
];
59-
let b = [
59+
const b = [
6060
1
6161
];
62-
let c = [
62+
const c = [
6363
1, 2
6464
];
65-
let d = [
65+
const d = [
6666
1,
6767
2
6868
];
69-
let e = [
69+
const e = [
7070
function foo() {
7171
dosomething();
7272
}
@@ -84,19 +84,19 @@ Examples of **incorrect** code for this rule with the `"never"` option:
8484
```js
8585
/*eslint array-bracket-newline: ["error", "never"]*/
8686

87-
let a = [
87+
const a = [
8888
];
89-
let b = [
89+
const b = [
9090
1
9191
];
92-
let c = [
92+
const c = [
9393
1, 2
9494
];
95-
let d = [
95+
const d = [
9696
1,
9797
2
9898
];
99-
let e = [
99+
const e = [
100100
function foo() {
101101
dosomething();
102102
}
@@ -112,12 +112,12 @@ Examples of **correct** code for this rule with the `"never"` option:
112112
```js
113113
/*eslint array-bracket-newline: ["error", "never"]*/
114114

115-
let a = [];
116-
let b = [1];
117-
let c = [1, 2];
118-
let d = [1,
115+
const a = [];
116+
const b = [1];
117+
const c = [1, 2];
118+
const d = [1,
119119
2];
120-
let e = [function foo() {
120+
const e = [function foo() {
121121
dosomething();
122122
}];
123123
```
@@ -133,15 +133,15 @@ Examples of **incorrect** code for this rule with the `"consistent"` option:
133133
```js
134134
/*eslint array-bracket-newline: ["error", "consistent"]*/
135135

136-
let a = [1
136+
const a = [1
137137
];
138-
let b = [
138+
const b = [
139139
1];
140-
let c = [function foo() {
140+
const c = [function foo() {
141141
dosomething();
142142
}
143143
]
144-
let d = [
144+
const d = [
145145
function foo() {
146146
dosomething();
147147
}]
@@ -156,17 +156,17 @@ Examples of **correct** code for this rule with the `"consistent"` option:
156156
```js
157157
/*eslint array-bracket-newline: ["error", "consistent"]*/
158158

159-
let a = [];
160-
let b = [
159+
const a = [];
160+
const b = [
161161
];
162-
let c = [1];
163-
let d = [
162+
const c = [1];
163+
const d = [
164164
1
165165
];
166-
let e = [function foo() {
166+
const e = [function foo() {
167167
dosomething();
168168
}];
169-
let f = [
169+
const f = [
170170
function foo() {
171171
dosomething();
172172
}
@@ -184,17 +184,17 @@ Examples of **incorrect** code for this rule with the default `{ "multiline": tr
184184
```js
185185
/*eslint array-bracket-newline: ["error", { "multiline": true }]*/
186186

187-
let a = [
187+
const a = [
188188
];
189-
let b = [
189+
const b = [
190190
1
191191
];
192-
let c = [
192+
const c = [
193193
1, 2
194194
];
195-
let d = [1,
195+
const d = [1,
196196
2];
197-
let e = [function foo() {
197+
const e = [function foo() {
198198
dosomething();
199199
}];
200200
```
@@ -208,14 +208,14 @@ Examples of **correct** code for this rule with the default `{ "multiline": true
208208
```js
209209
/*eslint array-bracket-newline: ["error", { "multiline": true }]*/
210210

211-
let a = [];
212-
let b = [1];
213-
let c = [1, 2];
214-
let d = [
211+
const a = [];
212+
const b = [1];
213+
const c = [1, 2];
214+
const d = [
215215
1,
216216
2
217217
];
218-
let e = [
218+
const e = [
219219
function foo() {
220220
dosomething();
221221
}
@@ -233,15 +233,15 @@ Examples of **incorrect** code for this rule with the `{ "minItems": 2 }` option
233233
```js
234234
/*eslint array-bracket-newline: ["error", { "minItems": 2 }]*/
235235

236-
let a = [
236+
const a = [
237237
];
238-
let b = [
238+
const b = [
239239
1
240240
];
241-
let c = [1, 2];
242-
let d = [1,
241+
const c = [1, 2];
242+
const d = [1,
243243
2];
244-
let e = [
244+
const e = [
245245
function foo() {
246246
dosomething();
247247
}
@@ -257,16 +257,16 @@ Examples of **correct** code for this rule with the `{ "minItems": 2 }` option:
257257
```js
258258
/*eslint array-bracket-newline: ["error", { "minItems": 2 }]*/
259259

260-
let a = [];
261-
let b = [1];
262-
let c = [
260+
const a = [];
261+
const b = [1];
262+
const c = [
263263
1, 2
264264
];
265-
let d = [
265+
const d = [
266266
1,
267267
2
268268
];
269-
let e = [function foo() {
269+
const e = [function foo() {
270270
dosomething();
271271
}];
272272
```
@@ -282,15 +282,15 @@ Examples of **incorrect** code for this rule with the `{ "multiline": true, "min
282282
```js
283283
/*eslint array-bracket-newline: ["error", { "multiline": true, "minItems": 2 }]*/
284284

285-
let a = [
285+
const a = [
286286
];
287-
let b = [
287+
const b = [
288288
1
289289
];
290-
let c = [1, 2];
291-
let d = [1,
290+
const c = [1, 2];
291+
const d = [1,
292292
2];
293-
let e = [function foo() {
293+
const e = [function foo() {
294294
dosomething();
295295
}];
296296
```
@@ -304,16 +304,16 @@ Examples of **correct** code for this rule with the `{ "multiline": true, "minIt
304304
```js
305305
/*eslint array-bracket-newline: ["error", { "multiline": true, "minItems": 2 }]*/
306306

307-
let a = [];
308-
let b = [1];
309-
let c = [
307+
const a = [];
308+
const b = [1];
309+
const c = [
310310
1, 2
311311
];
312-
let d = [
312+
const d = [
313313
1,
314314
2
315315
];
316-
let e = [
316+
const e = [
317317
function foo() {
318318
dosomething();
319319
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy