From db2f5f22495f1066bbc00d807da7178f20e79615 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Wed, 4 Nov 2015 14:58:48 -0800 Subject: [PATCH] I love fixing lints on my linter code --- scripts/tslint/preferConstRule.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/tslint/preferConstRule.ts b/scripts/tslint/preferConstRule.ts index c2592c90c9f..279cc6271e8 100644 --- a/scripts/tslint/preferConstRule.ts +++ b/scripts/tslint/preferConstRule.ts @@ -68,8 +68,8 @@ class PreferConstWalker extends Lint.RuleWalker { private errors: Lint.RuleFailure[] = []; private markAssignment(identifier: ts.Identifier) { const name = identifier.text; - for (var i = this.inScopeLetDeclarations.length - 1; i >= 0; i--) { - var declarations = this.inScopeLetDeclarations[i]; + for (let i = this.inScopeLetDeclarations.length - 1; i >= 0; i--) { + const declarations = this.inScopeLetDeclarations[i]; if (declarations[name]) { declarations[name].usages++; break; @@ -173,7 +173,7 @@ class PreferConstWalker extends Lint.RuleWalker { } private visitAnyForStatement(node: ts.ForOfStatement | ts.ForInStatement) { - let names: ts.Map = {}; + const names: ts.Map = {}; if (isLet(node.initializer)) { if (node.initializer.kind === ts.SyntaxKind.VariableDeclarationList) { this.collectLetIdentifiers(node.initializer as ts.VariableDeclarationList, names); @@ -195,7 +195,7 @@ class PreferConstWalker extends Lint.RuleWalker { } visitBlock(node: ts.Block) { - let names: ts.Map = {}; + const names: ts.Map = {}; for (let i = 0; i < node.statements.length; i++) { const statement = node.statements[i]; if (statement.kind === ts.SyntaxKind.VariableStatement) {