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

Changed no-string-based-set-x rules to use a walk function. #798

Merged
merged 2 commits into from
Jan 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/noStringBasedSetImmediateRule.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as ts from 'typescript';
import * as Lint from 'tslint';

import { NoStringParameterToFunctionCallWalker } from './utils/NoStringParameterToFunctionCallWalker';
import { createNoStringParameterToFunctionWalker } from './utils/createNoStringParameterToFunctionWalker';
import { ExtendedMetadata } from './utils/ExtendedMetadata';

export class Rule extends Lint.Rules.OptionallyTypedRule {
Expand All @@ -25,7 +25,6 @@ export class Rule extends Lint.Rules.OptionallyTypedRule {
}

public applyWithProgram(sourceFile: ts.SourceFile, program: ts.Program | undefined): Lint.RuleFailure[] {
const walker: Lint.RuleWalker = new NoStringParameterToFunctionCallWalker(sourceFile, 'setImmediate', this.getOptions(), program);
return this.applyWithWalker(walker);
return this.applyWithFunction(sourceFile, createNoStringParameterToFunctionWalker('setImmediate', this.getOptions(), program));
}
}
6 changes: 2 additions & 4 deletions src/noStringBasedSetIntervalRule.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as ts from 'typescript';
import * as Lint from 'tslint';

import { NoStringParameterToFunctionCallWalker } from './utils/NoStringParameterToFunctionCallWalker';
import { createNoStringParameterToFunctionWalker } from './utils/createNoStringParameterToFunctionWalker';
import { ExtendedMetadata } from './utils/ExtendedMetadata';

export class Rule extends Lint.Rules.OptionallyTypedRule {
Expand All @@ -25,8 +25,6 @@ export class Rule extends Lint.Rules.OptionallyTypedRule {
}

public applyWithProgram(sourceFile: ts.SourceFile, program: ts.Program | undefined): Lint.RuleFailure[] {
const walker: Lint.RuleWalker = new NoStringParameterToFunctionCallWalker(sourceFile, 'setInterval', this.getOptions(), program);

return this.applyWithWalker(walker);
return this.applyWithFunction(sourceFile, createNoStringParameterToFunctionWalker('setInterval', this.getOptions(), program));
}
}
5 changes: 2 additions & 3 deletions src/noStringBasedSetTimeoutRule.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as ts from 'typescript';
import * as Lint from 'tslint';

import { NoStringParameterToFunctionCallWalker } from './utils/NoStringParameterToFunctionCallWalker';
import { createNoStringParameterToFunctionWalker } from './utils/createNoStringParameterToFunctionWalker';
import { ExtendedMetadata } from './utils/ExtendedMetadata';

export class Rule extends Lint.Rules.OptionallyTypedRule {
Expand All @@ -25,7 +25,6 @@ export class Rule extends Lint.Rules.OptionallyTypedRule {
}

public applyWithProgram(sourceFile: ts.SourceFile, program: ts.Program | undefined): Lint.RuleFailure[] {
const walker: Lint.RuleWalker = new NoStringParameterToFunctionCallWalker(sourceFile, 'setTimeout', this.getOptions(), program);
return this.applyWithWalker(walker);
return this.applyWithFunction(sourceFile, createNoStringParameterToFunctionWalker('setTimeout', this.getOptions(), program));
}
}
53 changes: 0 additions & 53 deletions src/utils/NoStringParameterToFunctionCallWalker.ts

This file was deleted.

199 changes: 0 additions & 199 deletions src/utils/ScopedSymbolTrackingWalker.ts

This file was deleted.

Loading