From 1a6cdfc7284eb5c5a2a65c82226d2540e2b9c991 Mon Sep 17 00:00:00 2001 From: Chris Thielen Date: Mon, 13 Mar 2017 20:25:29 -0500 Subject: [PATCH] fix(noImplicitAny): Fix noimplicitany compliance Closes https://github.com/angular-ui/ui-router/issues/2693 --- src/common/common.ts | 2 +- src/resolve/resolveContext.ts | 2 +- src/transition/transitionHook.ts | 10 +++++----- tslint.json | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/common/common.ts b/src/common/common.ts index a6e07e17..cf584e04 100644 --- a/src/common/common.ts +++ b/src/common/common.ts @@ -617,7 +617,7 @@ function _arraysEq(a1: any[], a2: any[]) { return arrayTuples(a1, a2).reduce((b, t) => b && _equals(t[0], t[1]), true); } -export type sortfn = (a,b) => number; +export type sortfn = (a: any, b: any) => number; /** * Create a sort function diff --git a/src/resolve/resolveContext.ts b/src/resolve/resolveContext.ts index 7e90edd7..0b040a2c 100644 --- a/src/resolve/resolveContext.ts +++ b/src/resolve/resolveContext.ts @@ -17,7 +17,7 @@ const when = resolvePolicies.when; const ALL_WHENS = [when.EAGER, when.LAZY]; const EAGER_WHENS = [when.EAGER]; -export const NATIVE_INJECTOR_TOKEN = "Native Injector"; +export const NATIVE_INJECTOR_TOKEN: string = "Native Injector"; /** * Encapsulates Dependency Injection for a path of nodes diff --git a/src/transition/transitionHook.ts b/src/transition/transitionHook.ts index 5196475e..d7bb7287 100644 --- a/src/transition/transitionHook.ts +++ b/src/transition/transitionHook.ts @@ -27,8 +27,8 @@ let defaultOptions: TransitionHookOptions = { export type GetResultHandler = (hook: TransitionHook) => ResultHandler; export type GetErrorHandler = (hook: TransitionHook) => ErrorHandler; -export type ResultHandler = (result: HookResult) => Promise; -export type ErrorHandler = (error) => Promise; +export type ResultHandler = (result: HookResult) => Promise; +export type ErrorHandler = (error: any) => Promise; /** @hidden */ export class TransitionHook { @@ -62,13 +62,13 @@ export class TransitionHook { * These GetErrorHandler(s) are used by [[invokeHook]] below * Each HookType chooses a GetErrorHandler (See: [[TransitionService._defineCoreEvents]]) */ - static LOG_ERROR: GetErrorHandler = (hook: TransitionHook) => (error) => + static LOG_ERROR: GetErrorHandler = (hook: TransitionHook) => (error: any) => hook.logError(error); - static REJECT_ERROR: GetErrorHandler = (hook: TransitionHook) => (error) => + static REJECT_ERROR: GetErrorHandler = (hook: TransitionHook) => (error: any) => silentRejection(error); - static THROW_ERROR: GetErrorHandler = (hook: TransitionHook) => (error) => { + static THROW_ERROR: GetErrorHandler = (hook: TransitionHook) => (error: any) => { throw error; }; diff --git a/tslint.json b/tslint.json index b2a7fcd6..a2a89224 100644 --- a/tslint.json +++ b/tslint.json @@ -35,7 +35,7 @@ "no-trailing-comma": true, "no-trailing-whitespace": false, "no-unreachable": true, - "no-unused-expression": true, + "no-unused-expression": [true, "allow-fast-null-checks"], "no-unused-variable": true, "no-use-before-declare": true, "no-var-keyword": true,