From 011a023ea4aa626fc4759e866cd81728f4691be5 Mon Sep 17 00:00:00 2001 From: rare-magma Date: Wed, 24 Apr 2024 23:50:39 +0200 Subject: [PATCH] style: fix eslint warnings Signed-off-by: rare-magma --- src/context/BudgetContext.tsx | 11 ++++------- src/context/ConfigContext.tsx | 9 ++------- src/context/GeneralContext.tsx | 29 +++++++---------------------- 3 files changed, 13 insertions(+), 36 deletions(-) diff --git a/src/context/BudgetContext.tsx b/src/context/BudgetContext.tsx index 856e394..dfdc7ba 100644 --- a/src/context/BudgetContext.tsx +++ b/src/context/BudgetContext.tsx @@ -24,17 +24,15 @@ interface BudgetContextInterface { const BudgetContext = createContext({ budget: undefined, setBudget: (value: Budget | undefined, saveInHistory: boolean) => { + // eslint-disable-next-line @typescript-eslint/no-unused-expressions value; + // eslint-disable-next-line @typescript-eslint/no-unused-expressions saveInHistory; }, budgetList: [], - setBudgetList: (value: Budget[] | undefined) => { - value; - }, + setBudgetList: (value: Budget[] | undefined) => value, budgetNameList: [], - setBudgetNameList: (value: SearchOption[] | undefined) => { - value; - }, + setBudgetNameList: (value: SearchOption[] | undefined) => value, revenuePercentage: 0, past: [undefined], future: [undefined], @@ -151,5 +149,4 @@ function BudgetProvider({ children }: PropsWithChildren) { ); } -// eslint-disable-next-line react-refresh/only-export-components export { BudgetProvider, useBudget }; diff --git a/src/context/ConfigContext.tsx b/src/context/ConfigContext.tsx index 473a94b..1e0eb63 100644 --- a/src/context/ConfigContext.tsx +++ b/src/context/ConfigContext.tsx @@ -15,13 +15,9 @@ interface ConfigContextInterface { const ConfigContext = createContext({ intlConfig: { locale: userLang, currency: initialCurrencyCode }, - setIntlConfig: (value: IntlConfig) => { - value; - }, + setIntlConfig: (value: IntlConfig) => value, currency: initialCurrencyCode, - setCurrency: (value: string) => { - value; - }, + setCurrency: (value: string) => value, }); function useConfig() { @@ -57,5 +53,4 @@ function ConfigProvider({ children }: PropsWithChildren) { ); } -// eslint-disable-next-line react-refresh/only-export-components export { ConfigProvider, useConfig }; diff --git a/src/context/GeneralContext.tsx b/src/context/GeneralContext.tsx index 74eecdd..d67d2cc 100644 --- a/src/context/GeneralContext.tsx +++ b/src/context/GeneralContext.tsx @@ -38,33 +38,19 @@ interface GeneralContextInterface { const GeneralContext = createContext({ needReload: true, - setNeedReload: (value: boolean) => { - value; - }, + setNeedReload: (value: boolean) => value, loadingFromDB: true, - setLoadingFromDB: (value: boolean) => { - value; - }, + setLoadingFromDB: (value: boolean) => value, error: "", - setError: (value: string) => { - value; - }, + setError: (value: string) => value, csvErrors: [], - setCsvErrors: (value: CsvError[]) => { - value; - }, + setCsvErrors: (value: CsvError[]) => value, jsonErrors: [], - setJsonErrors: (value: JsonError[]) => { - value; - }, + setJsonErrors: (value: JsonError[]) => value, showError: false, - setShowError: (value: boolean) => { - value; - }, + setShowError: (value: boolean) => value, notifications: [], - setNotifications: (value: BudgetNotification[]) => { - value; - }, + setNotifications: (value: BudgetNotification[]) => value, }); function useGeneralContext() { @@ -144,5 +130,4 @@ function GeneralProvider({ children }: PropsWithChildren) { ); } -// eslint-disable-next-line react-refresh/only-export-components export { GeneralProvider, useGeneralContext };