diff --git a/src/fixNoRequireImportsFormatter.ts b/src/fixNoRequireImportsFormatter.ts index 502a13c5d..a1043b9cd 100644 --- a/src/fixNoRequireImportsFormatter.ts +++ b/src/fixNoRequireImportsFormatter.ts @@ -3,6 +3,8 @@ import {RuleFailure} from 'tslint'; import {BaseFormatter} from './utils/BaseFormatter'; +let warnedForDeprecation = false; + /** * Formatter that fixes your unused imports. */ @@ -11,6 +13,11 @@ export class Formatter extends BaseFormatter { /* tslint:enable:export-name */ constructor() { + if (!warnedForDeprecation) { + console.warn('The fix-no-var-keyword formatter is deprecated. Use --fix instead.'); + warnedForDeprecation = true; + } + super('no-require-imports', function (this: Formatter, failure: RuleFailure): void { const fileName: string = failure.getFileName(); const fileContents: string = this.readFile(fileName); diff --git a/src/fixNoVarKeywordFormatter.ts b/src/fixNoVarKeywordFormatter.ts index 3ec0b741b..5c6016c08 100644 --- a/src/fixNoVarKeywordFormatter.ts +++ b/src/fixNoVarKeywordFormatter.ts @@ -3,14 +3,21 @@ import {RuleFailure} from 'tslint'; import {BaseFormatter} from './utils/BaseFormatter'; +let warnedForDeprecation = false; + /** - * Formatter that fixes your unused imports. + * Formatter that fixes your var keywords. */ /* tslint:disable:export-name */ export class Formatter extends BaseFormatter { /* tslint:enable:export-name */ constructor() { + if (!warnedForDeprecation) { + console.warn('The fix-no-var-keyword formatter is deprecated. Use --fix instead.'); + warnedForDeprecation = true; + } + super('no-var-keyword', function (this: Formatter, failure: RuleFailure): void { const fileName: string = failure.getFileName(); const fileContents: string = this.readFile(fileName);