[is-promise] add linting (#18865)

This commit is contained in:
Dimitri Benin 2017-08-14 20:34:42 +02:00 committed by Mohamed Hegazy
parent 3ca58c26e4
commit 2692c4f925
3 changed files with 7 additions and 7 deletions

View File

@ -1,8 +1,8 @@
// Type definitions for is-promise
// Type definitions for is-promise 2.1
// Project: https://github.com/then/is-promise
// Definitions by: Daniel Rosenwasser <https://github.com/DanielRosenwasser>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export = isPromise;
declare function isPromise(obj: any): obj is PromiseLike<any>;
declare function isPromise(obj: any): obj is PromiseLike<any>;

View File

@ -1,15 +1,14 @@
import isPromise = require("is-promise");
isPromise({ then() { }});
isPromise({ then() {} });
isPromise(null);
isPromise({ });
isPromise({});
isPromise({then: true});
function f(x: number | PromiseLike<number>) {
if (isPromise(x)) {
x.then;
}
else {
} else {
x.toExponential;
}
}
}

View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }