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

Minor fix for prefer-const #2343

Merged
merged 1 commit into from
Mar 14, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/rules/preferConstRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class Rule extends Lint.Rules.AbstractRule {
public apply(sourceFile: ts.SourceFile): Lint.RuleFailure[] {
const options: Options = {
destructuringAll: this.ruleArguments.length !== 0 &&
this.ruleArguments[0].destructuring === "all",
this.ruleArguments[0].destructuring === OPTION_DESTRUCTURING_ALL,
};
const preferConstWalker = new PreferConstWalker(sourceFile, this.ruleName, options);
return this.applyWithWalker(preferConstWalker);
Expand Down Expand Up @@ -133,7 +133,8 @@ class PreferConstWalker extends Lint.AbstractWalker<Options> {
if (utils.isFunctionDeclaration(node) ||
utils.isMethodDeclaration(node) ||
utils.isFunctionExpression(node) ||
utils.isArrowFunction(node)) {
utils.isArrowFunction(node) ||
utils.isConstructorDeclaration(node)) {
// special handling for function parameters
// each parameter initializer can only reassign preceding parameters of variables of the containing scope
if (node.body !== undefined) {
Expand Down