Skip to content

Commit

Permalink
chore(global.d.ts): make optional arguments HMR's accept function
Browse files Browse the repository at this point in the history
sometimes those arguments aren't required like in `src/client/index.tsx` where is called without
them, also to avoid Eslint's complains
  • Loading branch information
aneurysmjs committed Aug 25, 2020
1 parent 477088c commit 7ed9012
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/app/store/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
);
}
Expand Down
3 changes: 0 additions & 3 deletions src/client/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/ban-ts-ignore */
/* eslint-disable no-undef */
import React from 'react';
import { createBrowserHistory } from 'history';
Expand All @@ -24,9 +23,7 @@ reactDOM[`${SSR ? 'hydrate' : 'render'}`](
);

if (process.env.NODE_ENV === 'development') {
// @ts-ignore
if (module.hot) {
// @ts-ignore
module.hot.accept();
}

Expand Down
4 changes: 2 additions & 2 deletions src/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ declare namespace NodeJS {
declare interface NodeModule {
hot: {
accept(
dependencies: Array<string> | string,
callback?: (updatedDependencies: Array<string | number>) => void,
dependencies?: Array<string> | string,
callback?: (updatedDependencies?: Array<string | number>) => void,
): void;
};
}
Expand Down

0 comments on commit 7ed9012

Please sign in to comment.