Skip to content

Commit 02a5ef6

Browse files
committed
Add setInterval/setTimeout
1 parent 1f10e74 commit 02a5ef6

File tree

4 files changed

+9
-0
lines changed

4 files changed

+9
-0
lines changed

src/harness/harnessLanguageService.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -766,6 +766,7 @@ namespace Harness.LanguageService {
766766
}
767767

768768
setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): any {
769+
// tslint:disable-next-line:ban
769770
return setTimeout(callback, ms, args);
770771
}
771772

src/testRunner/parallel/host.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,7 @@ namespace Harness.Parallel.Host {
302302
worker.timer = undefined;
303303
}
304304
else {
305+
// tslint:disable-next-line:ban
305306
worker.timer = setTimeout(killChild, data.payload.duration, data.payload);
306307
}
307308
break;
@@ -623,6 +624,7 @@ namespace Harness.Parallel.Host {
623624
shimNoopTestInterface(global);
624625
}
625626

627+
// tslint:disable-next-line:ban
626628
setTimeout(() => startDelayed(perfData, totalCost), 0); // Do real startup on next tick, so all unit tests have been collected
627629
}
628630
}

src/tsserver/server.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -705,6 +705,7 @@ namespace ts.server {
705705
// stat due to inconsistencies of fs.watch
706706
// and efficiency of stat on modern filesystems
707707
function startWatchTimer() {
708+
// tslint:disable-next-line:ban
708709
setInterval(() => {
709710
let count = 0;
710711
let nextToCheck = nextFileToCheck;

tslint.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
"no-unnecessary-type-assertion": true,
66

77
"array-type": [true, "array"],
8+
"ban": [
9+
true,
10+
"setInterval",
11+
"setTimeout"
12+
],
813
"ban-types": {
914
"options": [
1015
["Object", "Avoid using the `Object` type. Did you mean `object`?"],

0 commit comments

Comments
 (0)