From dbd0352e7bdfbf38360135df8c77b7f2acf533ff Mon Sep 17 00:00:00 2001 From: Kevin Welcher Date: Mon, 13 Aug 2018 09:52:13 -0400 Subject: [PATCH] Adds tslint ignore rule --- types/next/router.d.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/types/next/router.d.ts b/types/next/router.d.ts index 3072455e45..2b019625f6 100644 --- a/types/next/router.d.ts +++ b/types/next/router.d.ts @@ -90,8 +90,12 @@ export interface WithRouterProps { router: SingletonRouter; } -export function withRouter( - Component: React.ComponentType, +// Manually disabling the no-unnecessary-generics rule so users can +// retain type inference if they warp their component in withRouter +// without defining props explicitly +export function withRouter( + // tslint:disable-next-line:no-unnecessary-generics + Component: React.ComponentType>, ): React.ComponentType; declare const Router: SingletonRouter;