Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Commit

Permalink
Deprecated our --fix formatters
Browse files Browse the repository at this point in the history
Starts on #577
  • Loading branch information
Josh Goldberg committed Oct 24, 2018
1 parent e076605 commit c328bce
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/fixNoRequireImportsFormatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import {RuleFailure} from 'tslint';
import {BaseFormatter} from './utils/BaseFormatter';

let warnedForDeprecation = false;

/**
* Formatter that fixes your unused imports.
*/
Expand All @@ -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);
Expand Down
9 changes: 8 additions & 1 deletion src/fixNoVarKeywordFormatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c328bce

Please sign in to comment.