From d8150f8d2fb804020e4f9f315ba1d22eaf450ec8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomek=20=C5=81aziuk?= Date: Sun, 10 Jun 2018 12:20:57 +0200 Subject: [PATCH] lint --- types/universal-router/index.d.ts | 9 +++++---- types/universal-router/tslint.json | 2 +- .../universal-router-tests.ts | 20 +++++++++---------- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/types/universal-router/index.d.ts b/types/universal-router/index.d.ts index fdfd97ed1c..66c424d5f0 100644 --- a/types/universal-router/index.d.ts +++ b/types/universal-router/index.d.ts @@ -35,11 +35,11 @@ export interface ActionContext extends PathnameConte /** * Matched route object. */ - route: Route; + route: Route; /** * Middleware style function which can continue resolving. */ - next: (resume?: boolean, parent?: Route, prevResult?: any) => Promise; + next: (resume?: boolean, parent?: Route, prevResult?: any) => Promise; /** * Base URL path relative to the path of the current route. */ @@ -75,7 +75,7 @@ export interface Route { /** * automatically filled by the router */ - parent?: Route | null; + parent?: Route | null; /** * array of route objects */ @@ -107,7 +107,8 @@ export interface Options { export default class UniversalRouter { constructor(routes: Routes | Route, options?: Options) /** - * Traverses the list of routes in the order they are defined until it finds the first route that matches provided URL path string and whose action function returns anything other than null or undefined. + * Traverses the list of routes in the order they are defined until it finds the first route that matches provided URL path string + * and whose action function returns anything other than null or undefined. */ resolve(pathnameOrContext: string | PathnameContext): Promise; /** diff --git a/types/universal-router/tslint.json b/types/universal-router/tslint.json index e595b70d63..f93cf8562a 100644 --- a/types/universal-router/tslint.json +++ b/types/universal-router/tslint.json @@ -1,3 +1,3 @@ { - "extends": "dtslint/dt.json", + "extends": "dtslint/dt.json" } diff --git a/types/universal-router/universal-router-tests.ts b/types/universal-router/universal-router-tests.ts index 26fd8a21d1..0c92dad102 100644 --- a/types/universal-router/universal-router-tests.ts +++ b/types/universal-router/universal-router-tests.ts @@ -12,11 +12,11 @@ new UniversalRouter( }, baseUrl: '/base', errorHandler: (error) => { - console.error(error) - console.dir(error.context) + console.error(error); + console.dir(error.context); return error.code === 404 ? '

Page Not Found

' - : '

Oops! Something went wrong

' + : '

Oops! Something went wrong

'; }, }, ).resolve('/').then(console.log); @@ -48,18 +48,18 @@ new UniversalRouter({ new UniversalRouter({ path: '', // optional async action({ next }) { - console.log('middleware: start') - const child = await next() - console.log('middleware: end') - return child + console.log('middleware: start'); + const child = await next(); + console.log('middleware: end'); + return child; }, children: [ { path: '/hello', action() { - console.log('route: return a result') - return 'Hello, world!' + console.log('route: return a result'); + return 'Hello, world!'; }, }, ], -}) +});