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

Commit

Permalink
Mark RuleWalker and ProgramAwareRuleWalker as deprecated (#4413)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nazanin1369 authored and adidahiya committed Feb 23, 2019
1 parent 9785477 commit 4997ce7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/language/walker/programAwareRuleWalker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@ import { IOptions } from "../rule/rule";

import { RuleWalker } from "./ruleWalker";

export class ProgramAwareRuleWalker extends RuleWalker {
/**
* @deprecated
* RuleWalker-based rules are slow,
* so it's generally preferable to use applyWithFunction instead of applyWithWalker.
* @see https://github.com/palantir/tslint/issues/2522
*/
export class ProgramAwareRuleWalker extends RuleWalker { // tslint:disable-line deprecation
private readonly typeChecker: ts.TypeChecker;

constructor(
Expand Down
6 changes: 6 additions & 0 deletions src/language/walker/ruleWalker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ import { Fix, IOptions, Replacement, RuleFailure } from "../rule/rule";
import { SyntaxWalker } from "./syntaxWalker";
import { IWalker } from "./walker";

/**
* @deprecated
* RuleWalker-based rules are slow,
* so it's generally preferable to use applyWithFunction instead of applyWithWalker.
* @see https://github.com/palantir/tslint/issues/2522
*/
export class RuleWalker extends SyntaxWalker implements IWalker {
private readonly limit: number;
private readonly options?: any[];
Expand Down
2 changes: 1 addition & 1 deletion src/language/walker/scopeAwareRuleWalker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ import { RuleWalker } from "./ruleWalker";
* });
* }
*/
export abstract class ScopeAwareRuleWalker<T> extends RuleWalker {
export abstract class ScopeAwareRuleWalker<T> extends RuleWalker { // tslint:disable-line deprecation
private readonly scopeStack: T[];

constructor(sourceFile: ts.SourceFile, options: IOptions) {
Expand Down

0 comments on commit 4997ce7

Please sign in to comment.