mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-10 18:04:18 -05:00
Add setInterval/setTimeout
This commit is contained in:
@@ -766,6 +766,7 @@ namespace Harness.LanguageService {
|
||||
}
|
||||
|
||||
setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): any {
|
||||
// tslint:disable-next-line:ban
|
||||
return setTimeout(callback, ms, args);
|
||||
}
|
||||
|
||||
|
||||
@@ -302,6 +302,7 @@ namespace Harness.Parallel.Host {
|
||||
worker.timer = undefined;
|
||||
}
|
||||
else {
|
||||
// tslint:disable-next-line:ban
|
||||
worker.timer = setTimeout(killChild, data.payload.duration, data.payload);
|
||||
}
|
||||
break;
|
||||
@@ -623,6 +624,7 @@ namespace Harness.Parallel.Host {
|
||||
shimNoopTestInterface(global);
|
||||
}
|
||||
|
||||
// tslint:disable-next-line:ban
|
||||
setTimeout(() => startDelayed(perfData, totalCost), 0); // Do real startup on next tick, so all unit tests have been collected
|
||||
}
|
||||
}
|
||||
|
||||
@@ -705,6 +705,7 @@ namespace ts.server {
|
||||
// stat due to inconsistencies of fs.watch
|
||||
// and efficiency of stat on modern filesystems
|
||||
function startWatchTimer() {
|
||||
// tslint:disable-next-line:ban
|
||||
setInterval(() => {
|
||||
let count = 0;
|
||||
let nextToCheck = nextFileToCheck;
|
||||
|
||||
@@ -5,6 +5,11 @@
|
||||
"no-unnecessary-type-assertion": true,
|
||||
|
||||
"array-type": [true, "array"],
|
||||
"ban": [
|
||||
true,
|
||||
"setInterval",
|
||||
"setTimeout"
|
||||
],
|
||||
"ban-types": {
|
||||
"options": [
|
||||
["Object", "Avoid using the `Object` type. Did you mean `object`?"],
|
||||
|
||||
Reference in New Issue
Block a user