Skip to content

Commit

Permalink
Fix(style): avoid abusing typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
wenzowski committed Dec 10, 2019
1 parent b9a02dc commit 76558b6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions app/stories/mockNextRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import {action} from '@storybook/addon-actions';

declare type Url = string | UrlObject;

/* eslint-disable @typescript-eslint/consistent-type-assertions */
Router.router = {
const router: RouterType = {
...Router.router,
replace: async (url: Url, as?: Url, options?: {}): Promise<boolean> => {
action('Router#replace')(url, as, options);
Expand All @@ -18,7 +17,10 @@ Router.router = {
prefetch: async (url: Url, as?: Url, options?: {}): Promise<void> => {
action('Router#prefetch')(url, as, options);
}
} as RouterType;
/* eslint-enable @typescript-eslint/consistent-type-assertions */
};

// Monkeypatch the router instance
Router._router = Router.router;
Router.router = router;

export {Router};

0 comments on commit 76558b6

Please sign in to comment.