From 727338c3525ea6a95b5c3630b4dadfe84254220d Mon Sep 17 00:00:00 2001 From: yashim-deriv Date: Wed, 26 Jan 2022 12:18:52 +0800 Subject: [PATCH] chore: fix ts-eslint warnings --- src/components/hooks/use-debounced-effect.tsx | 2 +- src/components/localization/config.js | 7 +++---- src/pages/dmt5/_why-trader.tsx | 2 +- src/pages/interim/_love-trading.tsx | 2 +- src/pages/p2p/components/_hero.tsx | 3 +-- src/store/index.tsx | 4 ++-- 6 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/components/hooks/use-debounced-effect.tsx b/src/components/hooks/use-debounced-effect.tsx index f6064da5dd5..11d4caaae49 100644 --- a/src/components/hooks/use-debounced-effect.tsx +++ b/src/components/hooks/use-debounced-effect.tsx @@ -1,6 +1,6 @@ import { useEffect } from 'react' -export const useDebouncedEffect = (effect: () => void, deps: any[], delay: number): void => { +export const useDebouncedEffect = (effect: () => void, deps: unknown[], delay: number): void => { useEffect(() => { const handler = setTimeout(() => effect(), delay) diff --git a/src/components/localization/config.js b/src/components/localization/config.js index 64e365da71a..ce89b66a4f6 100644 --- a/src/components/localization/config.js +++ b/src/components/localization/config.js @@ -1,9 +1,9 @@ -import i18n from 'i18next' +import i18n, { use, t } from 'i18next' import { initReactI18next } from 'react-i18next' import { str as crc32 } from 'crc-32' import language_config from '../../../i18n-config' -i18n.use(initReactI18next).init({ +use(initReactI18next).init({ ns: ['translations'], defaultNS: 'translations', @@ -25,7 +25,6 @@ i18n.use(initReactI18next).init({ i18n.languages = Object.keys(language_config) -export const localize = (string, values) => - i18n.t(crc32(string), { defaultValue: string, ...values }) +export const localize = (string, values) => t(crc32(string), { defaultValue: string, ...values }) export default i18n diff --git a/src/pages/dmt5/_why-trader.tsx b/src/pages/dmt5/_why-trader.tsx index 49d00c9d5d1..dce322046a0 100644 --- a/src/pages/dmt5/_why-trader.tsx +++ b/src/pages/dmt5/_why-trader.tsx @@ -12,7 +12,7 @@ import device from 'themes/device' type CardContentType = { header: React.ReactElement text: React.ReactElement - image: any // Sean declared content as any + image: string key: number } diff --git a/src/pages/interim/_love-trading.tsx b/src/pages/interim/_love-trading.tsx index 91f03d99876..58c180897a7 100644 --- a/src/pages/interim/_love-trading.tsx +++ b/src/pages/interim/_love-trading.tsx @@ -133,7 +133,7 @@ const LeftCTASection = (params: LeftCTASectionProps) => { } type RightCTASectionProps = LeftCTASectionProps & { - button_props?: any + button_props?: unknown } const RightCTASection = (params: RightCTASectionProps) => { diff --git a/src/pages/p2p/components/_hero.tsx b/src/pages/p2p/components/_hero.tsx index 0cec5793e02..e63aa48148c 100644 --- a/src/pages/p2p/components/_hero.tsx +++ b/src/pages/p2p/components/_hero.tsx @@ -6,9 +6,8 @@ import { Header, QueryImage, ImageWrapper } from 'components/elements' import { localize, Localize } from 'components/localization' import { Background } from 'components/elements/background-image' import { LinkButton } from 'components/form' -import device from 'themes/device.js' +import device, { size } from 'themes/device.js' import { useBrowserResize } from 'components/hooks/use-browser-resize' -import { size } from 'themes/device' const BackgroundWrapper = styled(Background)` height: 100%; diff --git a/src/store/index.tsx b/src/store/index.tsx index 222b09acb22..ff5713b7ab2 100644 --- a/src/store/index.tsx +++ b/src/store/index.tsx @@ -10,12 +10,12 @@ type DerivProviderProps = { type WebsiteStatusType = { clients_country: string - crypto_config: any + crypto_config: unknown } export type DerivStoreType = { academy_data: AcademyDataType - crypto_config: any + crypto_config: unknown is_eu_country: boolean is_livechat_interactive: boolean is_loading_lc: boolean