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

deprecate typeof-compare #3286

Merged
merged 2 commits into from
Oct 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ruleLoader.ts
Expand Up @@ -52,7 +52,7 @@ export function loadRules(ruleOptionsList: IOptions[],
rules.push(rule);
}

if (Rule.metadata !== undefined && Rule.metadata.deprecationMessage !== undefined) {
if (Rule.metadata !== undefined && Boolean(Rule.metadata.deprecationMessage)) {
showWarningOnce(`${Rule.metadata.ruleName} is deprecated. ${Rule.metadata.deprecationMessage}`);
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/rules/typeofCompareRule.ts
Expand Up @@ -32,6 +32,9 @@ export class Rule extends Lint.Rules.AbstractRule {
optionExamples: [true],
type: "functionality",
typescriptOnly: false,
deprecationMessage: ts.versionMajorMinor as string === "2.1"
? "Starting from TypeScript 2.2 the compiler includes this check which makes this rule redundant."
: "",
};
/* tslint:enable:object-literal-sort-keys */

Expand Down