From 2ed0cc3f381d48d27688e730521c4fa8cd193b11 Mon Sep 17 00:00:00 2001 From: Juan A <30204147+jaas666@users.noreply.github.com> Date: Fri, 17 Nov 2023 19:18:19 -0600 Subject: [PATCH] Remove unused args --- packages/desktop-client/craco.config.ts | 4 ++-- .../src/browser-preload.browser.js | 10 +++++----- .../src/components/FixedSizeList.js | 6 +++--- .../src/components/ManageRules.tsx | 2 +- .../src/components/accounts/Account.js | 4 ++-- .../src/components/accounts/MobileAccount.js | 2 +- .../src/components/accounts/MobileAccounts.js | 2 +- .../src/components/budget/MobileBudget.js | 2 +- .../src/components/budget/MobileBudgetTable.js | 2 +- .../src/components/budget/SidebarCategory.tsx | 2 +- .../src/components/budget/SidebarGroup.tsx | 5 ++--- .../src/components/budget/index.tsx | 2 +- .../components/budget/report/components.tsx | 2 +- .../budget/rollover/BudgetSummary.tsx | 2 +- .../budget/rollover/CoverTooltip.tsx | 2 +- .../budget/rollover/TransferTooltip.tsx | 2 +- .../src/components/common/Menu.tsx | 2 +- .../src/components/mobile/MobileAmountInput.js | 2 +- .../src/components/modals/EditRule.js | 4 ++-- .../components/modals/ImportTransactions.js | 18 +++++++++--------- .../src/components/modals/SingleInput.tsx | 2 +- .../components/payees/ManagePayeesWithData.js | 2 +- .../src/components/payees/index.js | 1 - .../components/reports/CategorySelector.tsx | 6 +++--- .../src/components/reports/Header.js | 1 - .../src/components/reports/ReportSidebar.js | 1 - .../src/components/reports/ReportSummary.js | 2 +- .../components/reports/graphs/AreaGraph.tsx | 2 +- .../src/components/reports/graphs/BarGraph.tsx | 3 +-- .../components/reports/graphs/BarLineGraph.tsx | 11 +++-------- .../components/reports/graphs/DonutGraph.tsx | 5 ++--- .../components/reports/graphs/LineGraph.tsx | 6 +++--- .../reports/graphs/NetWorthGraph.tsx | 11 +++-------- .../components/reports/graphs/SankeyGraph.tsx | 2 +- .../reports/graphs/StackedBarGraph.tsx | 3 +-- .../spreadsheets/cash-flow-spreadsheet.tsx | 2 +- .../src/components/select/DateSelect.tsx | 2 +- .../src/components/sidebar/Accounts.tsx | 4 ++-- .../desktop-client/src/components/table.tsx | 9 +++------ .../transactions/MobileTransaction.js | 4 ++-- .../transactions/SimpleTransactionsTable.js | 2 -- .../transactions/TransactionsTable.test.js | 2 +- packages/desktop-client/src/global-events.js | 4 ++-- packages/desktop-electron/security.js | 6 +++--- packages/desktop-electron/updater.js | 6 +++--- .../migrations/1632571489012_remove_cache.js | 2 +- .../loot-core/src/client/actions/account.ts | 2 +- .../loot-core/src/client/actions/queries.ts | 2 +- .../loot-core/src/client/query-helpers.test.ts | 4 ++-- .../src/platform/client/fetch/index.web.ts | 4 ++-- .../src/platform/exceptions/index.browser.ts | 2 +- .../src/platform/exceptions/index.electron.ts | 2 +- .../src/platform/exceptions/index.testing.ts | 4 ++-- .../src/platform/exceptions/index.web.ts | 2 +- .../platform/server/asyncStorage/index.web.ts | 8 ++++---- .../platform/server/connection/index.api.ts | 2 +- .../src/platform/server/fs/index.web.ts | 2 +- .../src/platform/server/indexeddb/index.web.ts | 8 ++++---- .../loot-core/src/server/__mocks__/post.ts | 2 +- .../src/server/accounts/rules.test.ts | 2 +- .../loot-core/src/server/accounts/rules.ts | 2 +- packages/loot-core/src/server/api.ts | 4 ++-- packages/loot-core/src/server/aql/compiler.ts | 2 +- packages/loot-core/src/server/bench.ts | 2 +- packages/loot-core/src/server/cloud-storage.ts | 2 +- packages/loot-core/src/server/db/index.ts | 7 +------ .../loot-core/src/server/importers/actual.ts | 2 +- .../loot-core/src/server/importers/ynab4.ts | 2 +- packages/loot-core/src/server/main.ts | 2 +- packages/loot-core/src/server/migrate/cli.ts | 2 +- packages/loot-core/src/server/schedules/app.ts | 2 +- .../src/server/schedules/find-schedules.ts | 4 ++-- .../src/server/spreadsheet/spreadsheet.ts | 2 +- packages/loot-core/src/server/sync/index.ts | 2 +- .../src/server/tests/mockSyncServer.ts | 2 +- packages/loot-core/src/shared/async.test.ts | 4 ++-- 76 files changed, 120 insertions(+), 147 deletions(-) diff --git a/packages/desktop-client/craco.config.ts b/packages/desktop-client/craco.config.ts index 42a428979a2..df55fcfa751 100644 --- a/packages/desktop-client/craco.config.ts +++ b/packages/desktop-client/craco.config.ts @@ -22,7 +22,7 @@ if (process.env.REVIEW_ID) { module.exports = { webpack: { - configure: (webpackConfig, { env, paths }) => { + configure: webpackConfig => { webpackConfig.mode = process.env.NODE_ENV === 'development' ? 'development' : 'production'; @@ -92,7 +92,7 @@ module.exports = { return webpackConfig; }, }, - devServer: (devServerConfig, { env, paths, proxy, allowedHost }) => { + devServer: devServerConfig => { devServerConfig.onBeforeSetupMiddleware = server => { chokidar .watch([ diff --git a/packages/desktop-client/src/browser-preload.browser.js b/packages/desktop-client/src/browser-preload.browser.js index 2fa3e0fae5b..7964af91471 100644 --- a/packages/desktop-client/src/browser-preload.browser.js +++ b/packages/desktop-client/src/browser-preload.browser.js @@ -51,7 +51,7 @@ global.Actual = { window.location.reload(); }, - openFileDialog: async ({ filters = [], properties }) => { + openFileDialog: async ({ filters = [] }) => { return new Promise(resolve => { let createdElement = false; // Attempt to reuse an already-created file input. @@ -91,7 +91,7 @@ global.Actual = { .uploadFile(filename, ev.target.result) .then(() => resolve([filepath])); }; - reader.onerror = function (ev) { + reader.onerror = function () { alert('Error reading file'); }; } @@ -107,7 +107,7 @@ global.Actual = { }); }, - saveFile: (contents, defaultFilename, dialogTitle) => { + saveFile: (contents, defaultFilename) => { const temp = document.createElement('a'); temp.style = 'display: none'; temp.download = defaultFilename; @@ -121,9 +121,9 @@ global.Actual = { openURLInBrowser: url => { window.open(url, '_blank'); }, - onEventFromMain: (type, handler) => {}, + onEventFromMain: () => {}, applyAppUpdate: () => {}, - updateAppMenu: isBudgetOpen => {}, + updateAppMenu: () => {}, getServerSocket: async () => { return worker; diff --git a/packages/desktop-client/src/components/FixedSizeList.js b/packages/desktop-client/src/components/FixedSizeList.js index faaaabbf9d7..ada62c93fa9 100644 --- a/packages/desktop-client/src/components/FixedSizeList.js +++ b/packages/desktop-client/src/components/FixedSizeList.js @@ -8,7 +8,7 @@ import View from './common/View'; const IS_SCROLLING_DEBOUNCE_INTERVAL = 150; -const defaultItemKey = (index, data) => index; +const defaultItemKey = index => index; function ResizeObserver({ onResize, children }) { let ref = useResizeObserver(onResize); @@ -241,7 +241,7 @@ export default class FixedSizeList extends PureComponent { } }; - onHeaderResize = rect => { + onHeaderResize = () => { // this.setState({ headerHeight: rect.height }); }; @@ -268,7 +268,7 @@ export default class FixedSizeList extends PureComponent { } getItemOffset = index => index * this.props.itemSize; - getItemSize = index => this.props.itemSize; + getItemSize = () => this.props.itemSize; getEstimatedTotalSize = () => this.props.itemSize * this.props.itemCount; getOffsetForIndexAndAlignment = (index, align, scrollOffset) => { diff --git a/packages/desktop-client/src/components/ManageRules.tsx b/packages/desktop-client/src/components/ManageRules.tsx index 5a3ddad2b72..f7a64aacc96 100644 --- a/packages/desktop-client/src/components/ManageRules.tsx +++ b/packages/desktop-client/src/components/ManageRules.tsx @@ -236,7 +236,7 @@ function ManageRulesContent({ onSave: async newRule => { let newRules = await loadRules(); - setRules(rules => { + setRules(() => { let newIdx = newRules.findIndex(rule => rule.id === newRule.id); return newRules.slice(0, newIdx + 75); }); diff --git a/packages/desktop-client/src/components/accounts/Account.js b/packages/desktop-client/src/components/accounts/Account.js index 4d4096cfd3a..6a79cad8cf2 100644 --- a/packages/desktop-client/src/components/accounts/Account.js +++ b/packages/desktop-client/src/components/accounts/Account.js @@ -227,7 +227,7 @@ class AccountInternal extends PureComponent { } }; - let onUndo = async ({ tables, messages, undoTag }) => { + let onUndo = async ({ tables, messages }) => { await maybeRefetch(tables); // If all the messages are dealing with transactions, find the @@ -514,7 +514,7 @@ class AccountInternal extends PureComponent { }); } }, - mappedData => { + () => { return data; }, ); diff --git a/packages/desktop-client/src/components/accounts/MobileAccount.js b/packages/desktop-client/src/components/accounts/MobileAccount.js index 794c59a4c0c..ad0e6996610 100644 --- a/packages/desktop-client/src/components/accounts/MobileAccount.js +++ b/packages/desktop-client/src/components/accounts/MobileAccount.js @@ -40,7 +40,7 @@ const getSchedulesTransform = memoizeOne((id, hasSearch) => { }; }); -function PreviewTransactions({ accountId, children }) { +function PreviewTransactions({ children }) { let scheduleData = useCachedSchedules(); if (scheduleData == null) { diff --git a/packages/desktop-client/src/components/accounts/MobileAccounts.js b/packages/desktop-client/src/components/accounts/MobileAccounts.js index 186583d3a73..92baef3788c 100644 --- a/packages/desktop-client/src/components/accounts/MobileAccounts.js +++ b/packages/desktop-client/src/components/accounts/MobileAccounts.js @@ -124,7 +124,7 @@ function AccountCard({ account, updated, getBalanceQuery, onSelect }) { ); } -function EmptyMessage({ onAdd }) { +function EmptyMessage() { return ( diff --git a/packages/desktop-client/src/components/budget/MobileBudget.js b/packages/desktop-client/src/components/budget/MobileBudget.js index 0f3d5268617..31a2b53365b 100644 --- a/packages/desktop-client/src/components/budget/MobileBudget.js +++ b/packages/desktop-client/src/components/budget/MobileBudget.js @@ -353,7 +353,7 @@ class Budget extends Component { return ( - {({ refreshing, onRefresh }) => ( + {({ onRefresh }) => ( displayed} + formatter={() => displayed} width="flex" exposed={editing || temporary} onUpdate={value => { diff --git a/packages/desktop-client/src/components/budget/SidebarGroup.tsx b/packages/desktop-client/src/components/budget/SidebarGroup.tsx index 682ebd92917..8ee22df74e2 100644 --- a/packages/desktop-client/src/components/budget/SidebarGroup.tsx +++ b/packages/desktop-client/src/components/budget/SidebarGroup.tsx @@ -43,7 +43,6 @@ function SidebarGroup({ dragPreview, innerRef, style, - borderColor = theme.tableBorder, onEdit, onSave, onDelete, @@ -62,7 +61,7 @@ function SidebarGroup({ userSelect: 'none', WebkitUserSelect: 'none', }} - onClick={e => { + onClick={() => { onToggleCollapse(group.id); }} > @@ -168,7 +167,7 @@ function SidebarGroup({ > displayed} + formatter={() => displayed} width="flex" exposed={editing} onUpdate={value => { diff --git a/packages/desktop-client/src/components/budget/index.tsx b/packages/desktop-client/src/components/budget/index.tsx index dbc3f1bf594..eafd98b2219 100644 --- a/packages/desktop-client/src/components/budget/index.tsx +++ b/packages/desktop-client/src/components/budget/index.tsx @@ -506,7 +506,7 @@ const RolloverBudgetSummary = memo<{ month: string }>(props => { ); }); -export default function BudgetWrapper(props) { +export default function BudgetWrapper() { let startMonth = useSelector(state => state.prefs.local['budget.startMonth']); let collapsedPrefs = useSelector( state => state.prefs.local['budget.collapsed'], diff --git a/packages/desktop-client/src/components/budget/report/components.tsx b/packages/desktop-client/src/components/budget/report/components.tsx index 5162866fb63..05dc6649756 100644 --- a/packages/desktop-client/src/components/budget/report/components.tsx +++ b/packages/desktop-client/src/components/budget/report/components.tsx @@ -163,7 +163,7 @@ function BalanceTooltip({ onClose={tooltip.close} > { + onMenuSelect={() => { onBudgetAction(monthIndex, 'carryover', { category: categoryId, flag: !carryover, diff --git a/packages/desktop-client/src/components/budget/rollover/BudgetSummary.tsx b/packages/desktop-client/src/components/budget/rollover/BudgetSummary.tsx index b6b0a4142e4..08c7831b09e 100644 --- a/packages/desktop-client/src/components/budget/rollover/BudgetSummary.tsx +++ b/packages/desktop-client/src/components/budget/rollover/BudgetSummary.tsx @@ -274,7 +274,7 @@ export function BudgetSummary({ } = useRollover(); let [menuOpen, setMenuOpen] = useState(false); - function onMenuOpen(e) { + function onMenuOpen() { setMenuOpen(true); } diff --git a/packages/desktop-client/src/components/budget/rollover/CoverTooltip.tsx b/packages/desktop-client/src/components/budget/rollover/CoverTooltip.tsx index 9e24fcaf682..c2442e6cbd3 100644 --- a/packages/desktop-client/src/components/budget/rollover/CoverTooltip.tsx +++ b/packages/desktop-client/src/components/budget/rollover/CoverTooltip.tsx @@ -47,7 +47,7 @@ export default function CoverTooltip({ categoryGroups={categoryGroups} value={null} openOnFocus={true} - onUpdate={id => {}} + onUpdate={() => {}} onSelect={id => setCategory(id)} inputProps={{ inputRef: node, diff --git a/packages/desktop-client/src/components/budget/rollover/TransferTooltip.tsx b/packages/desktop-client/src/components/budget/rollover/TransferTooltip.tsx index 76a4d3b83e7..c9818733805 100644 --- a/packages/desktop-client/src/components/budget/rollover/TransferTooltip.tsx +++ b/packages/desktop-client/src/components/budget/rollover/TransferTooltip.tsx @@ -98,7 +98,7 @@ export default function TransferTooltip({ categoryGroups={categoryGroups} value={null} openOnFocus={true} - onUpdate={id => {}} + onUpdate={() => {}} onSelect={id => setCategory(id)} inputProps={{ onEnter: submit, placeholder: '(none)' }} /> diff --git a/packages/desktop-client/src/components/common/Menu.tsx b/packages/desktop-client/src/components/common/Menu.tsx index be4382405f3..616d74b4264 100644 --- a/packages/desktop-client/src/components/common/Menu.tsx +++ b/packages/desktop-client/src/components/common/Menu.tsx @@ -158,7 +158,7 @@ export default function Menu({ }} onMouseEnter={() => setHoveredIndex(idx)} onMouseLeave={() => setHoveredIndex(null)} - onClick={e => + onClick={() => !item.disabled && onMenuSelect && onMenuSelect(item.name) } > diff --git a/packages/desktop-client/src/components/mobile/MobileAmountInput.js b/packages/desktop-client/src/components/mobile/MobileAmountInput.js index 386f4a71be6..392d18670c2 100644 --- a/packages/desktop-client/src/components/mobile/MobileAmountInput.js +++ b/packages/desktop-client/src/components/mobile/MobileAmountInput.js @@ -48,7 +48,7 @@ class AmountInput extends PureComponent { } } - componentDidUpdate(prevProps, prevState) { + componentDidUpdate(prevProps, _prevState) { if (!prevProps.focused && this.props.focused) { this.focus(); } diff --git a/packages/desktop-client/src/components/modals/EditRule.js b/packages/desktop-client/src/components/modals/EditRule.js index b5d633c6c94..16743d94841 100644 --- a/packages/desktop-client/src/components/modals/EditRule.js +++ b/packages/desktop-client/src/components/modals/EditRule.js @@ -122,7 +122,7 @@ export function OpSelect({ ); } -function EditorButtons({ onAdd, onDelete, style }) { +function EditorButtons({ onAdd, onDelete }) { return ( <> {onDelete && ( @@ -309,7 +309,7 @@ let actionFields = [ 'date', 'amount', ].map(field => [field, mapField(field)]); -function ActionEditor({ ops, action, editorStyle, onChange, onDelete, onAdd }) { +function ActionEditor({ action, editorStyle, onChange, onDelete, onAdd }) { let { field, op, value, type, error, inputKey = 'initial' } = action; return ( diff --git a/packages/desktop-client/src/components/modals/ImportTransactions.js b/packages/desktop-client/src/components/modals/ImportTransactions.js index 11665ea71e8..10156ebe89a 100644 --- a/packages/desktop-client/src/components/modals/ImportTransactions.js +++ b/packages/desktop-client/src/components/modals/ImportTransactions.js @@ -133,7 +133,7 @@ function getFileType(filepath) { return rawType; } -function ParsedDate({ parseDateFormat, showParsed, dateFormat, date }) { +function ParsedDate({ parseDateFormat, dateFormat, date }) { let parsed = date && formatDate( @@ -185,29 +185,29 @@ function getInitialMappings(transactions) { } let dateField = key( - fields.find(([name, value]) => name.toLowerCase().includes('date')) || - fields.find(([name, value]) => value.match(/^\d+[-/]\d+[-/]\d+$/)), + fields.find(([name]) => name.toLowerCase().includes('date')) || + fields.find(([value]) => value.match(/^\d+[-/]\d+[-/]\d+$/)), ); let amountField = key( - fields.find(([name, value]) => name.toLowerCase().includes('amount')) || - fields.find(([name, value]) => value.match(/^-?[.,\d]+$/)), + fields.find(([name]) => name.toLowerCase().includes('amount')) || + fields.find(([value]) => value.match(/^-?[.,\d]+$/)), ); let payeeField = key( - fields.find(([name, value]) => name !== dateField && name !== amountField), + fields.find(([name]) => name !== dateField && name !== amountField), ); let notesField = key( fields.find( - ([name, value]) => + ([name]) => name !== dateField && name !== amountField && name !== payeeField, ), ); let inOutField = key( fields.find( - ([name, value]) => + ([name]) => name !== dateField && name !== amountField && name !== payeeField && @@ -974,7 +974,7 @@ export default function ImportTransactions({ modalProps, options }) { ); }} - renderItem={({ key, style, item, editing, focusedField }) => ( + renderItem={({ key, style, item }) => ( - + )} diff --git a/packages/desktop-client/src/components/payees/ManagePayeesWithData.js b/packages/desktop-client/src/components/payees/ManagePayeesWithData.js index a99364df503..97aeabd44b1 100644 --- a/packages/desktop-client/src/components/payees/ManagePayeesWithData.js +++ b/packages/desktop-client/src/components/payees/ManagePayeesWithData.js @@ -63,7 +63,7 @@ export default function ManagePayeesWithData({ initialSelectedIds }) { }; }, []); - async function onUndo({ tables, messages, meta, url }, scroll = false) { + async function onUndo({ tables, messages, meta }, _scroll = false) { if (!tables.includes('payees') && !tables.includes('payee_mapping')) { return; } diff --git a/packages/desktop-client/src/components/payees/index.js b/packages/desktop-client/src/components/payees/index.js index b679ea8797b..c49fe7b693f 100644 --- a/packages/desktop-client/src/components/payees/index.js +++ b/packages/desktop-client/src/components/payees/index.js @@ -170,7 +170,6 @@ const PayeeTable = forwardRef( navigator, categoryGroups, highlightedRows, - ruleActions, onUpdate, onViewRules, onCreateRule, diff --git a/packages/desktop-client/src/components/reports/CategorySelector.tsx b/packages/desktop-client/src/components/reports/CategorySelector.tsx index d41a512722e..ec443b770ce 100644 --- a/packages/desktop-client/src/components/reports/CategorySelector.tsx +++ b/packages/desktop-client/src/components/reports/CategorySelector.tsx @@ -80,7 +80,7 @@ export default function CategorySelector({ { + onChange={() => { const selectedCategoriesExcludingGroupCategories = selectedCategories.filter( selectedCategory => @@ -118,7 +118,7 @@ export default function CategorySelector({ paddingLeft: 10, }} > - {categoryGroup.categories.map((category, index) => { + {categoryGroup.categories.map(category => { const isChecked = selectedCategories.some( selectedCategory => selectedCategory.id === category.id, ); @@ -135,7 +135,7 @@ export default function CategorySelector({ { + onChange={() => { if (isChecked) { setSelectedCategories( selectedCategories.filter( diff --git a/packages/desktop-client/src/components/reports/Header.js b/packages/desktop-client/src/components/reports/Header.js index 1e8fc518501..d0f1752833e 100644 --- a/packages/desktop-client/src/components/reports/Header.js +++ b/packages/desktop-client/src/components/reports/Header.js @@ -63,7 +63,6 @@ function Header({ onDeleteFilter, onCondOpChange, headerPrefixItems, - selectGraph, }) { let location = useLocation(); let path = location.pathname; diff --git a/packages/desktop-client/src/components/reports/ReportSidebar.js b/packages/desktop-client/src/components/reports/ReportSidebar.js index 8a43f59d648..0053af492ed 100644 --- a/packages/desktop-client/src/components/reports/ReportSidebar.js +++ b/packages/desktop-client/src/components/reports/ReportSidebar.js @@ -54,7 +54,6 @@ export function ReportSidebar({ allMonths, graphType, setGraphType, - setViewLegend, typeDisabled, setTypeDisabled, groupBy, diff --git a/packages/desktop-client/src/components/reports/ReportSummary.js b/packages/desktop-client/src/components/reports/ReportSummary.js index 562de586050..0ed8bcd9b3b 100644 --- a/packages/desktop-client/src/components/reports/ReportSummary.js +++ b/packages/desktop-client/src/components/reports/ReportSummary.js @@ -136,7 +136,7 @@ export function ReportSummary({ ); } -export function ReportLegend({ data, legend, groupBy }) { +export function ReportLegend({ legend, groupBy }) { return ( - {(width, height, portalHost) => + {(width, height) => data.monthData && (
diff --git a/packages/desktop-client/src/components/reports/graphs/BarGraph.tsx b/packages/desktop-client/src/components/reports/graphs/BarGraph.tsx index 5b3e75b9a84..44ff0166e0c 100644 --- a/packages/desktop-client/src/components/reports/graphs/BarGraph.tsx +++ b/packages/desktop-client/src/components/reports/graphs/BarGraph.tsx @@ -146,7 +146,6 @@ function BarGraph({ empty, balanceTypeOp, compact, - domain, }: BarGraphProps) { const colorScale = getColorScale('qualitative'); const yAxis = ['Month', 'Year'].includes(groupBy) ? 'date' : 'name'; @@ -171,7 +170,7 @@ function BarGraph({ ...(compact && { height: 'auto' }), }} > - {(width, height, portalHost) => + {(width, height) => data[splitData] && (
diff --git a/packages/desktop-client/src/components/reports/graphs/BarLineGraph.tsx b/packages/desktop-client/src/components/reports/graphs/BarLineGraph.tsx index 390fa5e5a10..e5fe70303af 100644 --- a/packages/desktop-client/src/components/reports/graphs/BarLineGraph.tsx +++ b/packages/desktop-client/src/components/reports/graphs/BarLineGraph.tsx @@ -35,7 +35,7 @@ type CustomTooltipProps = { label?: string; }; -const CustomTooltip = ({ active, payload, label }: CustomTooltipProps) => { +const CustomTooltip = ({ active, payload }: CustomTooltipProps) => { if (active && payload && payload.length) { return (
{ return `${Math.round(tick).toLocaleString()}`; // Formats the tick values as strings with commas }; @@ -95,7 +90,7 @@ function BarLineGraph({ ...(compact && { height: 'auto' }), }} > - {(width, height, portalHost) => + {(width, height) => graphData && (
diff --git a/packages/desktop-client/src/components/reports/graphs/DonutGraph.tsx b/packages/desktop-client/src/components/reports/graphs/DonutGraph.tsx index 41798b395a4..3e04392817a 100644 --- a/packages/desktop-client/src/components/reports/graphs/DonutGraph.tsx +++ b/packages/desktop-client/src/components/reports/graphs/DonutGraph.tsx @@ -40,7 +40,7 @@ type CustomTooltipProps = { label?: string; }; -const CustomTooltip = ({ active, payload, label }: CustomTooltipProps) => { +const CustomTooltip = ({ active, payload }: CustomTooltipProps) => { if (active && payload && payload.length) { return (
- {(width, height, portalHost) => + {(width, height) => data[splitData] && (
diff --git a/packages/desktop-client/src/components/reports/graphs/LineGraph.tsx b/packages/desktop-client/src/components/reports/graphs/LineGraph.tsx index 1c373de3936..8b589e1a308 100644 --- a/packages/desktop-client/src/components/reports/graphs/LineGraph.tsx +++ b/packages/desktop-client/src/components/reports/graphs/LineGraph.tsx @@ -34,7 +34,7 @@ type CustomTooltipProps = { label?: string; }; -const CustomTooltip = ({ active, payload, label }: CustomTooltipProps) => { +const CustomTooltip = ({ active, payload }: CustomTooltipProps) => { if (active && payload && payload.length) { return (
{ return `${Math.round(tick).toLocaleString()}`; // Formats the tick values as strings with commas }; @@ -89,7 +89,7 @@ function LineGraph({ style, graphData, compact, domain }: LineGraphProps) { ...(compact && { height: 'auto' }), }} > - {(width, height, portalHost) => + {(width, height) => graphData && (
diff --git a/packages/desktop-client/src/components/reports/graphs/NetWorthGraph.tsx b/packages/desktop-client/src/components/reports/graphs/NetWorthGraph.tsx index 142ffb75d55..1d8dd916ccf 100644 --- a/packages/desktop-client/src/components/reports/graphs/NetWorthGraph.tsx +++ b/packages/desktop-client/src/components/reports/graphs/NetWorthGraph.tsx @@ -26,12 +26,7 @@ type NetWorthGraphProps = { }; }; -function NetWorthGraph({ - style, - graphData, - compact, - domain, -}: NetWorthGraphProps) { +function NetWorthGraph({ style, graphData, compact }: NetWorthGraphProps) { const tickFormatter = tick => { return `${Math.round(tick).toLocaleString()}`; // Formats the tick values as strings with commas }; @@ -69,7 +64,7 @@ function NetWorthGraph({ }; // eslint-disable-next-line react/no-unstable-nested-components - const CustomTooltip = ({ active, payload, label }: CustomTooltipProps) => { + const CustomTooltip = ({ active, payload }: CustomTooltipProps) => { if (active && payload && payload.length) { return (
- {(width, height, portalHost) => + {(width, height) => graphData && (
diff --git a/packages/desktop-client/src/components/reports/graphs/SankeyGraph.tsx b/packages/desktop-client/src/components/reports/graphs/SankeyGraph.tsx index de73a14d6f2..1bf88d8487d 100644 --- a/packages/desktop-client/src/components/reports/graphs/SankeyGraph.tsx +++ b/packages/desktop-client/src/components/reports/graphs/SankeyGraph.tsx @@ -113,7 +113,7 @@ function SankeyGraph({ style, data, compact }: SankeyProps) { ...(compact && { height: 'auto' }), }} > - {(width, height, portalHost) => ( + {width => ( - {(width, height, portalHost) => + {(width, height) => data.stackedData && (
diff --git a/packages/desktop-client/src/components/reports/spreadsheets/cash-flow-spreadsheet.tsx b/packages/desktop-client/src/components/reports/spreadsheets/cash-flow-spreadsheet.tsx index 34502fb48a2..9d7540f10b2 100644 --- a/packages/desktop-client/src/components/reports/spreadsheets/cash-flow-spreadsheet.tsx +++ b/packages/desktop-client/src/components/reports/spreadsheets/cash-flow-spreadsheet.tsx @@ -57,7 +57,7 @@ export function cashFlowByDate( }); const conditionsOpKey = conditionsOp === 'or' ? '$or' : '$and'; - function makeQuery(where) { + function makeQuery(_where) { let query = q('transactions') .filter({ [conditionsOpKey]: [...filters], diff --git a/packages/desktop-client/src/components/select/DateSelect.tsx b/packages/desktop-client/src/components/select/DateSelect.tsx index e08d8e60bb0..b2ead90cc4f 100644 --- a/packages/desktop-client/src/components/select/DateSelect.tsx +++ b/packages/desktop-client/src/components/select/DateSelect.tsx @@ -343,7 +343,7 @@ export default function DateSelect({ {...inputProps} inputRef={inputRef} value={value} - onPointerUp={e => { + onPointerUp={() => { if (!embedded) { setOpen(true); } diff --git a/packages/desktop-client/src/components/sidebar/Accounts.tsx b/packages/desktop-client/src/components/sidebar/Accounts.tsx index d250ec3311a..0ee408eea1c 100644 --- a/packages/desktop-client/src/components/sidebar/Accounts.tsx +++ b/packages/desktop-client/src/components/sidebar/Accounts.tsx @@ -77,7 +77,7 @@ function Accounts({ setIsDragging(drag.state === 'start'); } - let makeDropPadding = (i, length) => { + let makeDropPadding = (i, _length) => { if (i === 0) { return { paddingTop: isDragging ? 15 : 0, @@ -156,7 +156,7 @@ function Accounts({ )} {showClosedAccounts && - closedAccounts.map((account, i) => ( + closedAccounts.map(account => ( (({ fields, ...props }, ref) => { +>(({ fields, ...props }) => { let navigator = useTableNavigator(props.items, fields); return ; }); @@ -905,7 +905,6 @@ export const Table: ( style, navigator, onScroll, - version = 'v1', allowPopupsEscape, isSelected, saveScrollWidth, @@ -1044,7 +1043,7 @@ export const Table: ( ); } - function onItemsRendered({ overscanStartIndex, overscanStopIndex }) { + function onItemsRendered({ overscanStopIndex }) { if (loadMore && overscanStopIndex > items.length - 100) { loadMore(); } @@ -1136,9 +1135,7 @@ export const Table: ( renderRow={renderRow} itemCount={count || items.length} itemSize={rowHeight - 1} - itemKey={ - getItemKey || ((index, data) => items[index].id) - } + itemKey={getItemKey || (index => items[index].id)} indexForKey={key => items.findIndex(item => item.id === key) } diff --git a/packages/desktop-client/src/components/transactions/MobileTransaction.js b/packages/desktop-client/src/components/transactions/MobileTransaction.js index 688ff6f294e..d6e20d04488 100644 --- a/packages/desktop-client/src/components/transactions/MobileTransaction.js +++ b/packages/desktop-client/src/components/transactions/MobileTransaction.js @@ -228,7 +228,7 @@ class TransactionEditInner extends PureComponent { this.props.navigate(`/accounts/${account.id}`, { replace: true }); }; - onSaveChild = childTransaction => { + onSaveChild = () => { this.setState({ editingChild: null }); }; @@ -871,7 +871,7 @@ function TransactionEditUnconnected(props) { navigate={navigate} // TODO: ChildEdit is complicated and heavily relies on RN // renderChildEdit={props => } - renderChildEdit={props => {}} + renderChildEdit={() => {}} dateFormat={dateFormat} // TODO: was this a mistake in the original code? // onTapField={this.onTapField} diff --git a/packages/desktop-client/src/components/transactions/SimpleTransactionsTable.js b/packages/desktop-client/src/components/transactions/SimpleTransactionsTable.js index 076a682c5ed..b637e1cdde0 100644 --- a/packages/desktop-client/src/components/transactions/SimpleTransactionsTable.js +++ b/packages/desktop-client/src/components/transactions/SimpleTransactionsTable.js @@ -36,7 +36,6 @@ function serializeTransaction(transaction, dateFormat) { const TransactionRow = memo(function TransactionRow({ transaction, fields, - payees, categories, accounts, selected, @@ -137,7 +136,6 @@ const TransactionRow = memo(function TransactionRow({ export default function SimpleTransactionsTable({ transactions, - schedules, renderEmpty, fields = ['date', 'payee', 'amount'], style, diff --git a/packages/desktop-client/src/components/transactions/TransactionsTable.test.js b/packages/desktop-client/src/components/transactions/TransactionsTable.test.js index 27849cc6463..5af5a525143 100644 --- a/packages/desktop-client/src/components/transactions/TransactionsTable.test.js +++ b/packages/desktop-client/src/components/transactions/TransactionsTable.test.js @@ -774,7 +774,7 @@ describe('Transactions', () => { updateProps({ transactions }); function expectErrorToNotExist(transactions) { - transactions.forEach((transaction, idx) => { + transactions.forEach(transaction => { expect(transaction.error).toBeFalsy(); }); } diff --git a/packages/desktop-client/src/global-events.js b/packages/desktop-client/src/global-events.js index 1cc54f8766f..f141db02ce4 100644 --- a/packages/desktop-client/src/global-events.js +++ b/packages/desktop-client/src/global-events.js @@ -7,7 +7,7 @@ export function handleGlobalEvents(actions, store) { actions.setAppState({ updateInfo: info }); }); - global.Actual.onEventFromMain('update-error', msg => { + global.Actual.onEventFromMain('update-error', () => { // Ignore errors. We don't want to constantly bug the user if they // always have a flaky connection or have intentionally disabled // updates. They will see the error in the about page if they try @@ -18,7 +18,7 @@ export function handleGlobalEvents(actions, store) { actions.saveGlobalPrefs({ theme }); }; - listen('server-error', info => { + listen('server-error', () => { actions.addGenericErrorNotification(); }); diff --git a/packages/desktop-electron/security.js b/packages/desktop-electron/security.js index 08ef6933db3..b8d4ca06fda 100644 --- a/packages/desktop-electron/security.js +++ b/packages/desktop-electron/security.js @@ -1,7 +1,7 @@ const electron = require('electron'); electron.app.on('web-contents-created', function (event, contents) { - contents.on('will-attach-webview', function (event, webPreferences, params) { + contents.on('will-attach-webview', function (event, webPreferences) { delete webPreferences.preloadURL; delete webPreferences.preload; @@ -15,11 +15,11 @@ electron.app.on('web-contents-created', function (event, contents) { event.preventDefault(); }); - contents.on('will-navigate', (event, navigationUrl) => { + contents.on('will-navigate', event => { event.preventDefault(); }); - contents.on('new-window', (event, navigationUrl) => { + contents.on('new-window', event => { event.preventDefault(); }); }); diff --git a/packages/desktop-electron/updater.js b/packages/desktop-electron/updater.js index df447317e24..a01f62f0e1e 100644 --- a/packages/desktop-electron/updater.js +++ b/packages/desktop-electron/updater.js @@ -43,7 +43,7 @@ function fireEvent(type, args) { lastEvent = type; } -function start(handler) { +function start() { if (updateTimer) { return null; } @@ -53,7 +53,7 @@ function start(handler) { updateTimer = setInterval(() => { if (!isCheckingForUpdates) { - autoUpdater.checkForUpdates().catch(err => { + autoUpdater.checkForUpdates().catch(() => { // Do nothing with the error (make sure it's not logged to sentry) }); } @@ -74,7 +74,7 @@ function stop() { function check() { if (!isDev && !isCheckingForUpdates) { - autoUpdater.checkForUpdates().catch(err => { + autoUpdater.checkForUpdates().catch(() => { // Do nothing with the error (make sure it's not logged to sentry) }); } diff --git a/packages/loot-core/migrations/1632571489012_remove_cache.js b/packages/loot-core/migrations/1632571489012_remove_cache.js index 2f3764c47de..1e4b132f0f7 100644 --- a/packages/loot-core/migrations/1632571489012_remove_cache.js +++ b/packages/loot-core/migrations/1632571489012_remove_cache.js @@ -1,4 +1,4 @@ -export default async function runMigration(db, uuid) { +export default async function runMigration(db) { function getValue(node) { return node.expr != null ? node.expr : node.cachedValue; } diff --git a/packages/loot-core/src/client/actions/account.ts b/packages/loot-core/src/client/actions/account.ts index cecc9d8f3d4..5956d28e9fc 100644 --- a/packages/loot-core/src/client/actions/account.ts +++ b/packages/loot-core/src/client/actions/account.ts @@ -199,7 +199,7 @@ export function setLastTransaction( } export function parseTransactions(filepath, options) { - return async (dispatch: Dispatch) => { + return async () => { return await send('transactions-parse-file', { filepath, options, diff --git a/packages/loot-core/src/client/actions/queries.ts b/packages/loot-core/src/client/actions/queries.ts index c32d1ff5d65..d40e3d37a0c 100644 --- a/packages/loot-core/src/client/actions/queries.ts +++ b/packages/loot-core/src/client/actions/queries.ts @@ -217,7 +217,7 @@ export function updateGroup(group) { } export function deleteGroup(id, transferId?) { - return async function (dispatch, getState) { + return async function (dispatch) { await send('category-group-delete', { id, transferId }); await dispatch(getCategories()); // See `deleteCategory` for why we need this diff --git a/packages/loot-core/src/client/query-helpers.test.ts b/packages/loot-core/src/client/query-helpers.test.ts index 13b42a06f86..d8f9bb39630 100644 --- a/packages/loot-core/src/client/query-helpers.test.ts +++ b/packages/loot-core/src/client/query-helpers.test.ts @@ -361,7 +361,7 @@ describe('query helpers', () => { await tracer.expect('server-query', [{ result: { $count: '*' } }]); await tracer.expect('server-query', ['id']); - await tracer.expect('data', data => {}); + await tracer.expect('data', () => {}); paged.fetchNext(); paged.fetchNext(); @@ -369,7 +369,7 @@ describe('query helpers', () => { paged.fetchNext(); await tracer.expect('server-query', ['id']); - await tracer.expect('data', data => {}); + await tracer.expect('data', () => {}); // Wait a bit and make sure nothing comes through let p = Promise.race([tracer.expect('server-query'), wait(200)]); diff --git a/packages/loot-core/src/platform/client/fetch/index.web.ts b/packages/loot-core/src/platform/client/fetch/index.web.ts index b993bfc4bd6..6ceaa1c761d 100644 --- a/packages/loot-core/src/platform/client/fetch/index.web.ts +++ b/packages/loot-core/src/platform/client/fetch/index.web.ts @@ -69,7 +69,7 @@ function connectSocket(port, onOpen) { } }; - client.onopen = event => { + client.onopen = () => { // Send any messages that were queued while closed if (messageQueue.length > 0) { messageQueue.forEach(msg => { @@ -150,7 +150,7 @@ export const unlisten: T.Unlisten = function (name) { }; async function closeSocket(onClose) { - socketClient.onclose = event => { + socketClient.onclose = () => { socketClient = null; onClose(); }; diff --git a/packages/loot-core/src/platform/exceptions/index.browser.ts b/packages/loot-core/src/platform/exceptions/index.browser.ts index 56ccc5c37bb..95adc82959a 100644 --- a/packages/loot-core/src/platform/exceptions/index.browser.ts +++ b/packages/loot-core/src/platform/exceptions/index.browser.ts @@ -4,4 +4,4 @@ export const captureException: T.CaptureException = function (exc) { console.log('[Exception]', exc); }; -export const captureBreadcrumb: T.CaptureBreadcrumb = function (breadcrumb) {}; +export const captureBreadcrumb: T.CaptureBreadcrumb = function () {}; diff --git a/packages/loot-core/src/platform/exceptions/index.electron.ts b/packages/loot-core/src/platform/exceptions/index.electron.ts index 56ccc5c37bb..95adc82959a 100644 --- a/packages/loot-core/src/platform/exceptions/index.electron.ts +++ b/packages/loot-core/src/platform/exceptions/index.electron.ts @@ -4,4 +4,4 @@ export const captureException: T.CaptureException = function (exc) { console.log('[Exception]', exc); }; -export const captureBreadcrumb: T.CaptureBreadcrumb = function (breadcrumb) {}; +export const captureBreadcrumb: T.CaptureBreadcrumb = function () {}; diff --git a/packages/loot-core/src/platform/exceptions/index.testing.ts b/packages/loot-core/src/platform/exceptions/index.testing.ts index 988d67f8266..82e6c5422d3 100644 --- a/packages/loot-core/src/platform/exceptions/index.testing.ts +++ b/packages/loot-core/src/platform/exceptions/index.testing.ts @@ -1,5 +1,5 @@ import type * as T from '.'; -export const captureException: T.CaptureException = function (exc) {}; +export const captureException: T.CaptureException = function () {}; -export const captureBreadcrumb: T.CaptureBreadcrumb = function (info) {}; +export const captureBreadcrumb: T.CaptureBreadcrumb = function () {}; diff --git a/packages/loot-core/src/platform/exceptions/index.web.ts b/packages/loot-core/src/platform/exceptions/index.web.ts index 56ccc5c37bb..95adc82959a 100644 --- a/packages/loot-core/src/platform/exceptions/index.web.ts +++ b/packages/loot-core/src/platform/exceptions/index.web.ts @@ -4,4 +4,4 @@ export const captureException: T.CaptureException = function (exc) { console.log('[Exception]', exc); }; -export const captureBreadcrumb: T.CaptureBreadcrumb = function (breadcrumb) {}; +export const captureBreadcrumb: T.CaptureBreadcrumb = function () {}; diff --git a/packages/loot-core/src/platform/server/asyncStorage/index.web.ts b/packages/loot-core/src/platform/server/asyncStorage/index.web.ts index b81081c7147..c84f217dac5 100644 --- a/packages/loot-core/src/platform/server/asyncStorage/index.web.ts +++ b/packages/loot-core/src/platform/server/asyncStorage/index.web.ts @@ -33,7 +33,7 @@ export const setItem: T.SetItem = async function (key, value) { new Promise((resolve, reject) => { let req = objectStore.put(value, key); req.onerror = e => reject(e); - req.onsuccess = e => resolve(undefined); + req.onsuccess = () => resolve(undefined); commit(transaction); }); }; @@ -47,7 +47,7 @@ export const removeItem: T.RemoveItem = async function (key) { return new Promise((resolve, reject) => { let req = objectStore.delete(key); req.onerror = e => reject(e); - req.onsuccess = e => resolve(undefined); + req.onsuccess = () => resolve(undefined); commit(transaction); }); }; @@ -83,7 +83,7 @@ export const multiSet: T.MultiSet = async function (keyValues) { return new Promise((resolve, reject) => { let req = objectStore.put(value, key); req.onerror = e => reject(e); - req.onsuccess = e => resolve(undefined); + req.onsuccess = () => resolve(undefined); }); }), ); @@ -103,7 +103,7 @@ export const multiRemove: T.MultiRemove = async function (keys) { return new Promise((resolve, reject) => { let req = objectStore.delete(key); req.onerror = e => reject(e); - req.onsuccess = e => resolve(undefined); + req.onsuccess = () => resolve(undefined); }); }), ); diff --git a/packages/loot-core/src/platform/server/connection/index.api.ts b/packages/loot-core/src/platform/server/connection/index.api.ts index a28c787ae81..1aacd8372fa 100644 --- a/packages/loot-core/src/platform/server/connection/index.api.ts +++ b/packages/loot-core/src/platform/server/connection/index.api.ts @@ -2,7 +2,7 @@ import type * as T from '.'; export const init: T.Init = function () {}; -export const send: T.Send = function (type, args) { +export const send: T.Send = function () { // Nothing }; diff --git a/packages/loot-core/src/platform/server/fs/index.web.ts b/packages/loot-core/src/platform/server/fs/index.web.ts index d7685b82c7b..2bb399ece61 100644 --- a/packages/loot-core/src/platform/server/fs/index.web.ts +++ b/packages/loot-core/src/platform/server/fs/index.web.ts @@ -312,7 +312,7 @@ export const removeDirRecursively = async function (dirpath) { } }; -export const getModifiedTime = async function (filepath) { +export const getModifiedTime = async function () { throw new Error( 'getModifiedTime not supported on the web (only used for backups)', ); diff --git a/packages/loot-core/src/platform/server/indexeddb/index.web.ts b/packages/loot-core/src/platform/server/indexeddb/index.web.ts index d657a53f792..8e362b45bf5 100644 --- a/packages/loot-core/src/platform/server/indexeddb/index.web.ts +++ b/packages/loot-core/src/platform/server/indexeddb/index.web.ts @@ -33,7 +33,7 @@ function _openDatabase() { openRequest.onblocked = e => console.log('blocked', e); - openRequest.onerror = event => { + openRequest.onerror = () => { console.log('openRequest error'); reject(new Error('indexeddb-failure: Could not open IndexedDB')); }; @@ -101,7 +101,7 @@ export const getStore: T.GetStore = function (db, name) { export const get: T.Get = async function (store, key, mapper = x => x) { return new Promise((resolve, reject) => { let req = store.get(key); - req.onsuccess = e => { + req.onsuccess = () => { resolve(mapper(req.result)); }; req.onerror = e => reject(e); @@ -111,7 +111,7 @@ export const get: T.Get = async function (store, key, mapper = x => x) { export const set: T.Set = async function (store, item) { return new Promise((resolve, reject) => { let req = store.put(item); - req.onsuccess = e => resolve(undefined); + req.onsuccess = () => resolve(undefined); req.onerror = e => reject(e); }); }; @@ -119,7 +119,7 @@ export const set: T.Set = async function (store, item) { export const del: T.Del = async function (store, key) { return new Promise((resolve, reject) => { let req = store.delete(key); - req.onsuccess = e => resolve(undefined); + req.onsuccess = () => resolve(undefined); req.onerror = e => reject(e); }); }; diff --git a/packages/loot-core/src/server/__mocks__/post.ts b/packages/loot-core/src/server/__mocks__/post.ts index 89a961b872e..0d63da5150f 100644 --- a/packages/loot-core/src/server/__mocks__/post.ts +++ b/packages/loot-core/src/server/__mocks__/post.ts @@ -3,6 +3,6 @@ export { handleRequestBinary as postBinary, } from '../tests/mockSyncServer'; -export const get = function (url) { +export const get = function () { throw new Error('get unimplemented'); }; diff --git a/packages/loot-core/src/server/accounts/rules.test.ts b/packages/loot-core/src/server/accounts/rules.test.ts index f4942f1a154..b9ecb7c5b68 100644 --- a/packages/loot-core/src/server/accounts/rules.test.ts +++ b/packages/loot-core/src/server/accounts/rules.test.ts @@ -489,7 +489,7 @@ describe('Rule', () => { ]; let foundRules = []; - iterateIds(rules, 'description', (rule, value) => { + iterateIds(rules, 'description', rule => { foundRules.push(rule.getId()); }); expect(foundRules).toEqual(['first', 'second', 'second', 'third']); diff --git a/packages/loot-core/src/server/accounts/rules.ts b/packages/loot-core/src/server/accounts/rules.ts index 71aab527001..3cad9405676 100644 --- a/packages/loot-core/src/server/accounts/rules.ts +++ b/packages/loot-core/src/server/accounts/rules.ts @@ -518,7 +518,7 @@ export class Rule { }); } - execActions(object) { + execActions(_object) { let changes = {}; this.actions.forEach(action => action.exec(changes)); return changes; diff --git a/packages/loot-core/src/server/api.ts b/packages/loot-core/src/server/api.ts index 01190365df1..c423c15d827 100644 --- a/packages/loot-core/src/server/api.ts +++ b/packages/loot-core/src/server/api.ts @@ -252,7 +252,7 @@ handlers['api/finish-import'] = async function () { await handlers['get-budget-bounds'](); await sheet.waitOnSpreadsheet(); - await cloudStorage.upload().catch(err => {}); + await cloudStorage.upload().catch(() => {}); connection.send('finish-import'); IMPORT_MODE = false; @@ -420,7 +420,7 @@ handlers['api/transactions-get'] = async function ({ return data; }; -handlers['api/transactions-filter'] = async function ({ text, accountId }) { +handlers['api/transactions-filter'] = async function () { throw new Error('`filterTransactions` is deprecated, use `runQuery` instead'); }; diff --git a/packages/loot-core/src/server/aql/compiler.ts b/packages/loot-core/src/server/aql/compiler.ts index 03281504e93..20077c0083c 100644 --- a/packages/loot-core/src/server/aql/compiler.ts +++ b/packages/loot-core/src/server/aql/compiler.ts @@ -991,7 +991,7 @@ export function compileQuery( let { tableViews = {}, - tableFilters = name => [], + tableFilters = () => [], customizeQuery = queryState => queryState, } = schemaConfig; diff --git a/packages/loot-core/src/server/bench.ts b/packages/loot-core/src/server/bench.ts index cb50c267e22..2cd59860bc4 100644 --- a/packages/loot-core/src/server/bench.ts +++ b/packages/loot-core/src/server/bench.ts @@ -8,7 +8,7 @@ const queries = fs .split('___BOUNDARY') .map(q => q.trim()); -function runQueries(n?) { +function runQueries() { for (let i = 0; i < queries.length; i++) { if (queries[i] !== '') { db.runQuery(queries[i], [], true); diff --git a/packages/loot-core/src/server/cloud-storage.ts b/packages/loot-core/src/server/cloud-storage.ts index a7a7f9c7a42..901f4ec4c7e 100644 --- a/packages/loot-core/src/server/cloud-storage.ts +++ b/packages/loot-core/src/server/cloud-storage.ts @@ -326,7 +326,7 @@ export async function possiblyUpload() { } // Don't block on uploading - upload().catch(err => {}); + upload().catch(() => {}); } export async function removeFile(fileId) { diff --git a/packages/loot-core/src/server/db/index.ts b/packages/loot-core/src/server/db/index.ts index a06e08dc2d9..f0d6cda6433 100644 --- a/packages/loot-core/src/server/db/index.ts +++ b/packages/loot-core/src/server/db/index.ts @@ -601,12 +601,7 @@ export async function getTransaction(id) { return rows[0]; } -export async function getTransactionsByDate( - accountId, - startDate, - endDate, - options = {}, -) { +export async function getTransactionsByDate() { throw new Error('`getTransactionsByDate` is deprecated'); } diff --git a/packages/loot-core/src/server/importers/actual.ts b/packages/loot-core/src/server/importers/actual.ts index ac1fe39dba4..16011de75de 100644 --- a/packages/loot-core/src/server/importers/actual.ts +++ b/packages/loot-core/src/server/importers/actual.ts @@ -42,5 +42,5 @@ export default async function importActual(_filepath: string, buffer: Buffer) { await handlers['load-budget']({ id }); await handlers['get-budget-bounds'](); await waitOnSpreadsheet(); - await cloudStorage.upload().catch(err => {}); + await cloudStorage.upload().catch(() => {}); } diff --git a/packages/loot-core/src/server/importers/ynab4.ts b/packages/loot-core/src/server/importers/ynab4.ts index bc314b644d7..dae37000f01 100644 --- a/packages/loot-core/src/server/importers/ynab4.ts +++ b/packages/loot-core/src/server/importers/ynab4.ts @@ -198,7 +198,7 @@ async function importTransactions( subtransactions: transaction.subTransactions && - transaction.subTransactions.map((t, i) => { + transaction.subTransactions.map(t => { return { id: entityIdMap.get(t.entityId), amount: amountToInteger(t.amount), diff --git a/packages/loot-core/src/server/main.ts b/packages/loot-core/src/server/main.ts index 52802c93653..b9b94b555b2 100644 --- a/packages/loot-core/src/server/main.ts +++ b/packages/loot-core/src/server/main.ts @@ -1849,7 +1849,7 @@ handlers['delete-budget'] = async function ({ id, cloudFileId }) { // If it's a cloud file, you can delete it from the server by // passing its cloud id if (cloudFileId) { - await cloudStorage.removeFile(cloudFileId).catch(err => {}); + await cloudStorage.removeFile(cloudFileId).catch(() => {}); } // If a local file exists, you can delete it by passing its local id diff --git a/packages/loot-core/src/server/migrate/cli.ts b/packages/loot-core/src/server/migrate/cli.ts index 75cdf303c6e..117bbad2a2c 100755 --- a/packages/loot-core/src/server/migrate/cli.ts +++ b/packages/loot-core/src/server/migrate/cli.ts @@ -45,7 +45,7 @@ function create(migrationName) { fs.writeFileSync(up, 'BEGIN TRANSACTION;\n\nCOMMIT;', 'utf8'); } -async function list(db) { +async function list(_db) { const migrationsDir = getMigrationsDir(); const applied = await getAppliedMigrations(getDatabase()); const all = await getMigrationList(migrationsDir); diff --git a/packages/loot-core/src/server/schedules/app.ts b/packages/loot-core/src/server/schedules/app.ts index 7d3fcfbc71f..d2ecb300858 100644 --- a/packages/loot-core/src/server/schedules/app.ts +++ b/packages/loot-core/src/server/schedules/app.ts @@ -550,7 +550,7 @@ app.method('schedule/get-upcoming-dates', getUpcomingDates); app.service(trackJSONPaths); -app.events.on('sync', ({ type, subtype }) => { +app.events.on('sync', ({ type }) => { let completeEvent = type === 'success' || type === 'error' || type === 'unauthorized'; diff --git a/packages/loot-core/src/server/schedules/find-schedules.ts b/packages/loot-core/src/server/schedules/find-schedules.ts index 3eb2efe8ab9..dcb5acda879 100644 --- a/packages/loot-core/src/server/schedules/find-schedules.ts +++ b/packages/loot-core/src/server/schedules/find-schedules.ts @@ -48,7 +48,7 @@ function getRank(day1, day2) { return 1 / (dayDiff + 1); } -function matchSchedules(allOccurs, config, partialMatchRank = 0.5) { +function matchSchedules(allOccurs, config, _partialMatchRank = 0.5) { allOccurs = [...allOccurs].reverse(); let baseOccur = allOccurs[0]; let occurs = allOccurs.slice(1); @@ -363,7 +363,7 @@ export async function findSchedules() { } let schedules = [...groupBy(allSchedules, 'payee').entries()].map( - ([payeeId, schedules]) => { + ([schedules]) => { schedules.sort((s1, s2) => s2.rank - s1.rank); let winner = schedules[0]; diff --git a/packages/loot-core/src/server/spreadsheet/spreadsheet.ts b/packages/loot-core/src/server/spreadsheet/spreadsheet.ts index f098d85cd2e..04944028926 100644 --- a/packages/loot-core/src/server/spreadsheet/spreadsheet.ts +++ b/packages/loot-core/src/server/spreadsheet/spreadsheet.ts @@ -77,7 +77,7 @@ export default class Spreadsheet { return this.nodes.has(name); } - add(name, expr, value) { + add(name, expr) { this.set(name, expr); } diff --git a/packages/loot-core/src/server/sync/index.ts b/packages/loot-core/src/server/sync/index.ts index 114c337906b..70a12bd1ede 100644 --- a/packages/loot-core/src/server/sync/index.ts +++ b/packages/loot-core/src/server/sync/index.ts @@ -130,7 +130,7 @@ async function fetchAll(table, ids) { } sql += ` WHERE `; - sql += partIds.map(id => `${column} = ?`).join(' OR '); + sql += partIds.map(() => `${column} = ?`).join(' OR '); try { let rows = await db.runQuery(sql, partIds, true); diff --git a/packages/loot-core/src/server/tests/mockSyncServer.ts b/packages/loot-core/src/server/tests/mockSyncServer.ts index 09db3b76321..b1150fbafa5 100644 --- a/packages/loot-core/src/server/tests/mockSyncServer.ts +++ b/packages/loot-core/src/server/tests/mockSyncServer.ts @@ -81,7 +81,7 @@ handlers['/plaid/handoff_public_token'] = () => { // Do nothing }; -handlers['/plaid/accounts'] = ({ client_id, group_id, item_id }) => { +handlers['/plaid/accounts'] = () => { // Ignore the parameters and just return the accounts. return { accounts: currentMockData.accounts }; }; diff --git a/packages/loot-core/src/shared/async.test.ts b/packages/loot-core/src/shared/async.test.ts index 3f545b5da71..bd39a36384b 100644 --- a/packages/loot-core/src/shared/async.test.ts +++ b/packages/loot-core/src/shared/async.test.ts @@ -59,7 +59,7 @@ describe('async', () => { test('sequential fn should still flush queue when error is thrown', async () => { const test = async fn => { fn(1); - fn(2, { throwError: true }).catch(err => {}); + fn(2, { throwError: true }).catch(() => {}); await fn(3); }; @@ -85,7 +85,7 @@ describe('async', () => { // happened in here, it wouldn't effect anything else) expect(data).toEqual([1, 1, 1, 2]); }); - fn(2, { throwError: true }).catch(err => { + fn(2, { throwError: true }).catch(() => { // Same as above expect(data).toEqual([1, 1, 1, 2, 3]); });