diff --git a/src/ruleLoader.ts b/src/ruleLoader.ts index bbf33c2f2f8..d7afc59eed5 100644 --- a/src/ruleLoader.ts +++ b/src/ruleLoader.ts @@ -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}`); } } diff --git a/src/rules/typeofCompareRule.ts b/src/rules/typeofCompareRule.ts index 303c8b34c0d..d1499adf176 100644 --- a/src/rules/typeofCompareRule.ts +++ b/src/rules/typeofCompareRule.ts @@ -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 */