diff --git a/package.json b/package.json index a4c4d81..7265c1c 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,6 @@ "url": "sindresorhus.com" }, "main": "dist/index.js", - "typings": "dist/index.d.ts", "engines": { "node": ">=4" }, @@ -18,7 +17,7 @@ "prerelease": "npm run build", "pretest": "npm run compile -- --sourceMap", "test": "npm run lint && nyc ava dist/test", - "lint": "tslint --project .", + "lint": "tslint --format stylish --project .", "build": "npm run clean && webpack", "compile": "npm run clean && tsc", "clean": "del dist" @@ -47,7 +46,7 @@ "object" ], "devDependencies": { - "@sindresorhus/is": "^0.4.0", + "@sindresorhus/is": "^0.5.0", "@types/node": "^8.0.31", "ava": "*", "awesome-typescript-loader": "^3.2.3", @@ -62,6 +61,7 @@ "vali-date": "^1.0.0", "webpack": "^3.8.1" }, + "typings": "dist/index.d.ts", "nyc": { "exclude": [ "dist/test" diff --git a/source/lib/argument-error.ts b/source/lib/argument-error.ts index 5168735..4e893cb 100644 --- a/source/lib/argument-error.ts +++ b/source/lib/argument-error.ts @@ -1,5 +1,5 @@ export class ArgumentError extends Error { - constructor(message, context) { + constructor(message: string, context: Function) { super(message); // TODO: Node does not preserve the error name in output when using the below, why? Error.captureStackTrace(this, context); diff --git a/source/lib/predicates/array.ts b/source/lib/predicates/array.ts index 1daa516..1c1a354 100644 --- a/source/lib/predicates/array.ts +++ b/source/lib/predicates/array.ts @@ -129,7 +129,7 @@ export class ArrayPredicate extends Predicate { * @param predicate The predicate that should be applied against every individual item. */ ofType(predicate: Predicate) { - let error; + let error: string; return this.addValidator({ message: () => error, diff --git a/source/lib/predicates/number.ts b/source/lib/predicates/number.ts index 784779c..5ada34b 100644 --- a/source/lib/predicates/number.ts +++ b/source/lib/predicates/number.ts @@ -1,4 +1,4 @@ -import * as is from '@sindresorhus/is'; +import is from '@sindresorhus/is'; import {Predicate, Context} from './predicate'; export class NumberPredicate extends Predicate { diff --git a/source/lib/predicates/predicate.ts b/source/lib/predicates/predicate.ts index 88cafe0..f520535 100644 --- a/source/lib/predicates/predicate.ts +++ b/source/lib/predicates/predicate.ts @@ -1,4 +1,4 @@ -import * as is from '@sindresorhus/is'; +import is from '@sindresorhus/is'; import {not} from '../operators/not'; export interface Validator {