Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Commit

Permalink
Turn on strictPropertyInitialization for src/ and test/. (#3924)
Browse files Browse the repository at this point in the history
Some Walker fields had to be initialized with inline initializers.
  • Loading branch information
rkirov authored and jkillian committed May 23, 2018
1 parent d04d026 commit 1f16db8
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/rules/noDuplicateVariableRule.ts
Expand Up @@ -63,7 +63,7 @@ export class Rule extends Lint.Rules.AbstractRule {
}

class NoDuplicateVariableWalker extends Lint.AbstractWalker<Options> {
private scope: Set<string>;
private scope: Set<string> = new Set();
public walk(sourceFile: ts.SourceFile) {
this.scope = new Set();
const cb = (node: ts.Node): void => {
Expand Down
2 changes: 1 addition & 1 deletion src/rules/noShadowedVariableRule.ts
Expand Up @@ -150,7 +150,7 @@ class Scope {
}

class NoShadowedVariableWalker extends Lint.AbstractWalker<Options> {
private scope: Scope;
private scope: Scope = new Scope();
public walk(sourceFile: ts.SourceFile) {
if (sourceFile.isDeclarationFile) {
return;
Expand Down
2 changes: 1 addition & 1 deletion src/rules/preferConstRule.ts
Expand Up @@ -121,7 +121,7 @@ interface DestructuringInfo {
}

class PreferConstWalker extends Lint.AbstractWalker<Options> {
private scope: Scope;
private scope: Scope = new Scope();
public walk(sourceFile: ts.SourceFile) {
// don't check anything on declaration files
if (sourceFile.isDeclarationFile) {
Expand Down
1 change: 1 addition & 0 deletions src/tsconfig.json
Expand Up @@ -8,6 +8,7 @@
"noUnusedLocals": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"strictPropertyInitialization": true,
"importHelpers": true,
"declaration": true,
"sourceMap": false,
Expand Down
1 change: 1 addition & 0 deletions test/tsconfig.json
Expand Up @@ -8,6 +8,7 @@
"noUnusedLocals": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"strictPropertyInitialization": true,
"sourceMap": true,
"target": "es5",
"lib": ["es6"],
Expand Down

0 comments on commit 1f16db8

Please sign in to comment.