From 0b9e00f058f7b29fec659f98eb7c77dbec01b4d9 Mon Sep 17 00:00:00 2001 From: Prashant Tiwari Date: Thu, 29 Dec 2016 13:20:31 +0530 Subject: [PATCH] Fix linter warnings --- code/code-tests.ts | 2 +- code/index.d.ts | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/code/code-tests.ts b/code/code-tests.ts index f84d2c852d..f90d2c9eb7 100644 --- a/code/code-tests.ts +++ b/code/code-tests.ts @@ -31,7 +31,7 @@ expect(err).to.be.an.error(Error); expect(err).to.be.an.error("Oops an error occured."); expect(err).to.be.an.error(Error, /occured/); -expect(function () { return; }).to.be.a.function(); +expect(func).to.be.a.function(); expect(123).to.be.a.number(); diff --git a/code/index.d.ts b/code/index.d.ts index 50c58d3a24..db59f6bf93 100644 --- a/code/index.d.ts +++ b/code/index.d.ts @@ -10,7 +10,7 @@ declare function fail(message: string): void; /** Returns the total number of assertions created using the expect() method. */ declare function count(): number; /** Returns an array of the locations where incomplete assertions were declared or null if no incomplete assertions found. */ -declare function incomplete(): Array | null; +declare function incomplete(): string[] | null; /** Returns the filename, line number, and column number of where the error was created. */ declare function thrownAt(error?: Error): CodeError; /** Configure code. */ @@ -20,9 +20,9 @@ export { expect, fail, count, incomplete, thrownAt, settings }; type AssertionChain = Assertion & Expectation; -interface Assertion extends Grammar, Flags { } +type Assertion = Grammar & Flags; -interface Expectation extends Types, Values { } +type Expectation = Types & Values; interface Grammar { /** Connecting word. */ @@ -80,7 +80,7 @@ interface Types { /** Asserts that the reference value is a Date. */ date(): AssertionChain; /** Asserts that the reference value is an error. */ - error(type?: Object, message?: string | RegExp): AssertionChain; + error(type?: any, message?: string | RegExp): AssertionChain; /** Asserts that the reference value is a function. */ function(): AssertionChain; /** Asserts that the reference value is a number. */ @@ -155,9 +155,9 @@ interface Values { /** Asserts that the reference value is about the provided value within a delta margin of difference. */ about(value: number, delta: number): AssertionChain; /** Asserts that the reference value has the provided instanceof value. */ - instanceof(type: Object): AssertionChain; + instanceof(type: any): AssertionChain; /** Asserts that the reference value has the provided instanceof value. */ - instanceOf(type: Object): AssertionChain; + instanceOf(type: any): AssertionChain; /** Asserts that the reference value's toString() representation matches the provided regular expression. */ match(regex: RegExp): AssertionChain; /** Asserts that the reference value's toString() representation matches the provided regular expression. */ @@ -167,9 +167,9 @@ interface Values { /** Asserts that the reference value satisfies the provided validator function. */ satisfies(validator: (value: T) => boolean): AssertionChain; /** Asserts that the function reference value throws an exception when called. */ - throw(type?: Object, message?: string | RegExp): AssertionChain; + throw(type?: any, message?: string | RegExp): AssertionChain; /** Asserts that the function reference value throws an exception when called. */ - throws(type?: Object, message?: string | RegExp): AssertionChain; + throws(type?: any, message?: string | RegExp): AssertionChain; } interface Settings {