diff --git a/src/rules/noDuplicateVariableRule.ts b/src/rules/noDuplicateVariableRule.ts index cef34a8cc65..8bce94b79c3 100644 --- a/src/rules/noDuplicateVariableRule.ts +++ b/src/rules/noDuplicateVariableRule.ts @@ -63,7 +63,7 @@ export class Rule extends Lint.Rules.AbstractRule { } class NoDuplicateVariableWalker extends Lint.AbstractWalker { - private scope: Set; + private scope: Set = new Set(); public walk(sourceFile: ts.SourceFile) { this.scope = new Set(); const cb = (node: ts.Node): void => { diff --git a/src/rules/noShadowedVariableRule.ts b/src/rules/noShadowedVariableRule.ts index b29c999308c..0f4af2f49ba 100644 --- a/src/rules/noShadowedVariableRule.ts +++ b/src/rules/noShadowedVariableRule.ts @@ -150,7 +150,7 @@ class Scope { } class NoShadowedVariableWalker extends Lint.AbstractWalker { - private scope: Scope; + private scope: Scope = new Scope(); public walk(sourceFile: ts.SourceFile) { if (sourceFile.isDeclarationFile) { return; diff --git a/src/rules/preferConstRule.ts b/src/rules/preferConstRule.ts index 984f95dd782..9c15345fb91 100644 --- a/src/rules/preferConstRule.ts +++ b/src/rules/preferConstRule.ts @@ -121,7 +121,7 @@ interface DestructuringInfo { } class PreferConstWalker extends Lint.AbstractWalker { - private scope: Scope; + private scope: Scope = new Scope(); public walk(sourceFile: ts.SourceFile) { // don't check anything on declaration files if (sourceFile.isDeclarationFile) { diff --git a/src/tsconfig.json b/src/tsconfig.json index 319e241f1e4..c410e416125 100644 --- a/src/tsconfig.json +++ b/src/tsconfig.json @@ -8,6 +8,7 @@ "noUnusedLocals": true, "strictNullChecks": true, "strictFunctionTypes": true, + "strictPropertyInitialization": true, "importHelpers": true, "declaration": true, "sourceMap": false, diff --git a/test/tsconfig.json b/test/tsconfig.json index d9458ba5b48..772bb2cb5d8 100644 --- a/test/tsconfig.json +++ b/test/tsconfig.json @@ -8,6 +8,7 @@ "noUnusedLocals": true, "strictNullChecks": true, "strictFunctionTypes": true, + "strictPropertyInitialization": true, "sourceMap": true, "target": "es5", "lib": ["es6"],