From 7ed90124900e217949ddcf8544a5d416217f0efe Mon Sep 17 00:00:00 2001 From: jero Date: Tue, 25 Aug 2020 14:44:06 +0300 Subject: [PATCH] chore(global.d.ts): make optional arguments HMR's accept function sometimes those arguments aren't required like in `src/client/index.tsx` where is called without them, also to avoid Eslint's complains --- src/app/store/index.tsx | 2 +- src/client/index.tsx | 3 --- src/global.d.ts | 4 ++-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/app/store/index.tsx b/src/app/store/index.tsx index 073a548e..5d69ded2 100644 --- a/src/app/store/index.tsx +++ b/src/app/store/index.tsx @@ -5,7 +5,7 @@ const store = configureStore(); if (process.env.NODE_ENV !== 'production') { if (module.hot) { module.hot.accept('~/store/config/alienStore', () => - // eslint-disable-next-line implicit-arrow-linebreak, global-require + // eslint-disable-next-line implicit-arrow-linebreak, global-require, @typescript-eslint/no-var-requires require('~/store/config/alienStore').default.reloadStore(), ); } diff --git a/src/client/index.tsx b/src/client/index.tsx index dbaeab28..bc8c3f15 100644 --- a/src/client/index.tsx +++ b/src/client/index.tsx @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/ban-ts-ignore */ /* eslint-disable no-undef */ import React from 'react'; import { createBrowserHistory } from 'history'; @@ -24,9 +23,7 @@ reactDOM[`${SSR ? 'hydrate' : 'render'}`]( ); if (process.env.NODE_ENV === 'development') { - // @ts-ignore if (module.hot) { - // @ts-ignore module.hot.accept(); } diff --git a/src/global.d.ts b/src/global.d.ts index 3fccd0ad..c262e793 100644 --- a/src/global.d.ts +++ b/src/global.d.ts @@ -21,8 +21,8 @@ declare namespace NodeJS { declare interface NodeModule { hot: { accept( - dependencies: Array | string, - callback?: (updatedDependencies: Array) => void, + dependencies?: Array | string, + callback?: (updatedDependencies?: Array) => void, ): void; }; }