From 5a3a64028c56a658623e8e877eb252b33f29a69d Mon Sep 17 00:00:00 2001 From: Waseem Ahmad <42496021+waseemahmad31@users.noreply.github.com> Date: Sun, 5 May 2019 07:00:34 +0530 Subject: [PATCH] Deprecate no-use-before-declare rule for typescript >= 2.9.0 (#4695) --- src/rules/noUseBeforeDeclareRule.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/rules/noUseBeforeDeclareRule.ts b/src/rules/noUseBeforeDeclareRule.ts index ae3bf5deddd..bc8eb868ae0 100644 --- a/src/rules/noUseBeforeDeclareRule.ts +++ b/src/rules/noUseBeforeDeclareRule.ts @@ -15,6 +15,7 @@ * limitations under the License. */ +import * as semver from "semver"; import { isBindingElement } from "tsutils"; import * as ts from "typescript"; @@ -42,6 +43,9 @@ export class Rule extends Lint.Rules.TypedRule { typescriptOnly: false, requiresTypeInfo: true, codeExamples, + deprecationMessage: semver.gte(ts.version, "2.9.0-dev.0") + ? "Since TypeScript 2.9. Please use the built-in compiler checks instead." + : undefined, }; /* tslint:enable:object-literal-sort-keys */