Skip to content
This repository was archived by the owner on Oct 15, 2020. It is now read-only.

Commit 82ad0b3

Browse files
committed
Added back jslint prefer-const rule
Issue #132 is fixed in chakracore so adding back the jslint rule of prefer-const.
1 parent 0e514a5 commit 82ad0b3

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ rules:
7373
# ECMAScript 6
7474
# list: http://eslint.org/docs/rules/#ecmascript-6
7575
## Suggest using 'const' wherever possible
76-
prefer-const: 1
76+
prefer-const: 2
7777

7878
# Strict Mode
7979
# list: https://github.com/eslint/eslint/tree/master/docs/rules#strict-mode

lib/repl.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class LineParser {
8787
this.shouldFail = false;
8888
const wasWithinStrLiteral = this._literal !== null;
8989

90-
for (let current of line) {
90+
for (const current of line) {
9191
if (previous === '\\') {
9292
// valid escaping, skip processing. previous doesn't matter anymore
9393
previous = null;

lib/util.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ function formatCollectionIterator(ctx, value, recurseTimes, visibleKeys, keys) {
517517
var nextRecurseTimes = recurseTimes === null ? null : recurseTimes - 1;
518518
var vals = mirror.preview();
519519
var output = [];
520-
for (let o of vals) {
520+
for (const o of vals) {
521521
output.push(formatValue(ctx, o, nextRecurseTimes));
522522
}
523523
return output;

test/parallel/test-http-response-multiheaders.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ const norepeat = [
1717
const server = http.createServer(function(req, res) {
1818
var num = req.headers['x-num'];
1919
if (num == 1) {
20-
for (let name of norepeat) {
20+
for (const name of norepeat) {
2121
res.setHeader(name, ['A', 'B']);
2222
}
2323
res.setHeader('X-A', ['A', 'B']);
2424
} else if (num == 2) {
2525
const headers = {};
26-
for (let name of norepeat) {
26+
for (const name of norepeat) {
2727
headers[name] = ['A', 'B'];
2828
}
2929
headers['X-A'] = ['A', 'B'];
@@ -44,7 +44,7 @@ server.listen(common.PORT, common.mustCall(function() {
4444
{port:common.PORT, headers:{'x-num': n}},
4545
common.mustCall(function(res) {
4646
if (n == 2) server.close();
47-
for (let name of norepeat) {
47+
for (const name of norepeat) {
4848
assert.equal(res.headers[name], 'A');
4949
}
5050
assert.equal(res.headers['x-a'], 'A, B');

test/parallel/test-util-inspect.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ map.set(1, 2);
135135
var mirror = Debug.MakeMirror(map.entries(), true);
136136
var vals = mirror.preview();
137137
var valsOutput = [];
138-
for (let o of vals) {
138+
for (const o of vals) {
139139
valsOutput.push(o);
140140
}
141141

0 commit comments

Comments
 (0)