From ec1aeef49132ae07833df93a7d396cbbef7db165 Mon Sep 17 00:00:00 2001 From: Matiss Janis Aboltins <matiss@mja.lv> Date: Mon, 2 Jan 2023 13:25:06 +0000 Subject: [PATCH] chore: fix some more no-unused-vars issues --- .../accounts/TransactionsTable.test.js | 25 +------------------ .../src/components/debug/index.js | 12 ++++----- .../components/tutorial/TransactionEnter.js | 5 +--- 3 files changed, 8 insertions(+), 34 deletions(-) diff --git a/packages/desktop-client/src/components/accounts/TransactionsTable.test.js b/packages/desktop-client/src/components/accounts/TransactionsTable.test.js index fef6ec829..9cfe6fb98 100644 --- a/packages/desktop-client/src/components/accounts/TransactionsTable.test.js +++ b/packages/desktop-client/src/components/accounts/TransactionsTable.test.js @@ -248,28 +248,6 @@ function keyWithShift(key) { return { ...key, shiftKey: true }; } -function verifySortOrder(transactions) { - transactions.forEach((transaction, idx) => { - let lastTransaction = idx === 0 ? null : transactions[idx]; - - if (transaction.sort_order == null) { - throw new Error("Transaction doesn't have sort_order"); - } - - if ( - lastTransaction && - transaction.sort_order > lastTransaction.sort_order - ) { - throw new Error( - 'Transaction sort order must always be decreasing. Found increasing sort order:\n ' + - JSON.stringify(lastTransaction) + - '\n ' + - JSON.stringify(transaction) - ); - } - }); -} - function renderTransactions(extraProps) { let transactions = generateTransactions(5, [6]); // Hardcoding the first value makes it easier for tests to do @@ -599,7 +577,6 @@ describe('Transactions', () => { test('dropdown selects an item when clicking', async () => { const { container, getTransactions } = renderTransactions(); - let input = editField(container, 'category', 2); let tooltip = container.querySelector('[data-testid="tooltip"]'); // Make sure none of the items are highlighted @@ -705,7 +682,7 @@ describe('Transactions', () => { }); test('dropdown escape resets the value ', () => { - const { container, getTransactions } = renderTransactions(); + const { container } = renderTransactions(); let input = editField(container, 'category', 2); let oldValue = input.value; diff --git a/packages/desktop-client/src/components/debug/index.js b/packages/desktop-client/src/components/debug/index.js index 9270c4949..8eb5687f8 100644 --- a/packages/desktop-client/src/components/debug/index.js +++ b/packages/desktop-client/src/components/debug/index.js @@ -56,7 +56,7 @@ class Debug extends React.Component { } async fetchSqlGenResult() { - let row = {}; + let row = {}; // eslint-disable-line try { row = (0, eval)('(' + this.state.sqlgenRow + ')'); // eslint-disable-line } catch (e) {} @@ -85,11 +85,11 @@ class Debug extends React.Component { render() { const { - value, - outputType, - ast, - code, - sql, + // value, + // outputType, + // ast, + // code, + // sql, sqlgenValue, sqlgenRow, sqlgenResult diff --git a/packages/desktop-client/src/components/tutorial/TransactionEnter.js b/packages/desktop-client/src/components/tutorial/TransactionEnter.js index 00db523b4..bacb05b80 100644 --- a/packages/desktop-client/src/components/tutorial/TransactionEnter.js +++ b/packages/desktop-client/src/components/tutorial/TransactionEnter.js @@ -1,14 +1,11 @@ import React from 'react'; -import * as monthUtils from 'loot-core/src/shared/months'; import { P } from 'loot-design/src/components/common'; import { Standalone, Title } from './common'; import Navigation from './Navigation'; -function TransactionEnter({ fromYNAB, navigationProps }) { - const currentDay = monthUtils.currentDay(); - +function TransactionEnter({ navigationProps }) { return ( <Standalone width={400}> <Title>Add a transaction</Title> -- GitLab