diff --git a/.eslintrc.js b/.eslintrc.js
index f0ee86d..6c47a52 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -1,10 +1,39 @@
module.exports = {
- plugins: ['prettier'],
+ plugins: ['prettier', 'import'],
extends: ['react-app'],
rules: {
'prettier/prettier': 'error',
'no-unused-vars': 'off',
'no-loop-func': 'off',
- 'no-restricted-globals': 'off'
+ 'no-restricted-globals': 'off',
+
+ 'import/no-useless-path-segments': 'error',
+ 'import/order': [
+ 'error',
+ {
+ alphabetize: {
+ caseInsensitive: true,
+ order: 'asc'
+ },
+ groups: [
+ 'builtin', // Built-in types are first
+ 'external',
+ ['sibling', 'parent'], // Then sibling and parent types. They can be mingled together
+ 'index' // Then the index file
+ ],
+ 'newlines-between': 'always',
+ pathGroups: [
+ // Enforce that React (and react-related packages) is the first import
+ { group: 'builtin', pattern: 'react?(-*)', position: 'before' },
+ // Separate imports from Actual from "real" external imports
+ {
+ group: 'external',
+ pattern: 'loot-{core,design}/**/*',
+ position: 'after'
+ }
+ ],
+ pathGroupsExcludedImportTypes: ['react']
+ }
+ ]
}
};
diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml
index 23cbc54..73ebbf1 100644
--- a/.github/ISSUE_TEMPLATE/bug-report.yml
+++ b/.github/ISSUE_TEMPLATE/bug-report.yml
@@ -65,10 +65,11 @@ body:
id: operating-system
attributes:
label: Operating System
- description: What version of our software are you running?
+ description: What operating system are you using?
options:
- Windows 11
- Windows 10
+ - Mac OSX
- Linux
- Mobile Device
- Other
diff --git a/packages/desktop-client/package.json b/packages/desktop-client/package.json
index 8074bd4..4e8f5ff 100644
--- a/packages/desktop-client/package.json
+++ b/packages/desktop-client/package.json
@@ -32,7 +32,7 @@
"eslint-config-react-app": "3.0.5",
"eslint-loader": "2.1.1",
"eslint-plugin-flowtype": "2.50.1",
- "eslint-plugin-import": "2.14.0",
+ "eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsx-a11y": "6.1.2",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-react": "7.11.1",
diff --git a/packages/desktop-client/src/components/AnimatedRefresh.js b/packages/desktop-client/src/components/AnimatedRefresh.js
index 4318fea..175529f 100644
--- a/packages/desktop-client/src/components/AnimatedRefresh.js
+++ b/packages/desktop-client/src/components/AnimatedRefresh.js
@@ -1,5 +1,7 @@
import React from 'react';
+
import { css } from 'glamor';
+
import { View } from 'loot-design/src/components/common';
import Refresh from 'loot-design/src/svg/v1/Refresh';
diff --git a/packages/desktop-client/src/components/App.js b/packages/desktop-client/src/components/App.js
index 2280386..1698d20 100644
--- a/packages/desktop-client/src/components/App.js
+++ b/packages/desktop-client/src/components/App.js
@@ -1,19 +1,22 @@
import React from 'react';
import { connect } from 'react-redux';
+
import { css } from 'glamor';
+
import * as actions from 'loot-core/src/client/actions';
import {
init as initConnection,
send
} from 'loot-core/src/platform/client/fetch';
import { styles, hasHiddenScrollbars } from 'loot-design/src/style';
+
import installPolyfills from '../polyfills';
-import FatalError from './FatalError';
-import ManagementApp from './manager/ManagementApp';
-import FinancesApp from './FinancesApp';
import AppBackground from './AppBackground';
-import UpdateNotification from './UpdateNotification';
+import FatalError from './FatalError';
+import FinancesApp from './FinancesApp';
+import ManagementApp from './manager/ManagementApp';
import MobileWebMessage from './MobileWebMessage';
+import UpdateNotification from './UpdateNotification';
class App extends React.Component {
state = {
diff --git a/packages/desktop-client/src/components/AppBackground.js b/packages/desktop-client/src/components/AppBackground.js
index f01ff69..ba8a1f1 100644
--- a/packages/desktop-client/src/components/AppBackground.js
+++ b/packages/desktop-client/src/components/AppBackground.js
@@ -1,8 +1,11 @@
import React from 'react';
-import { View, Block } from 'loot-design/src/components/common';
+
import { css } from 'glamor';
-import AnimatedLoading from 'loot-design/src/svg/v1/AnimatedLoading';
+
+import { View, Block } from 'loot-design/src/components/common';
import { colors } from 'loot-design/src/style';
+import AnimatedLoading from 'loot-design/src/svg/v1/AnimatedLoading';
+
import Background from './Background';
function AppBackground({ initializing, loadingText }) {
diff --git a/packages/desktop-client/src/components/Background.js b/packages/desktop-client/src/components/Background.js
index fe39d02..7d337ad 100644
--- a/packages/desktop-client/src/components/Background.js
+++ b/packages/desktop-client/src/components/Background.js
@@ -1,4 +1,5 @@
import React from 'react';
+
import { css } from 'glamor';
import BG from './manager/bg.svg';
diff --git a/packages/desktop-client/src/components/BankSyncStatus.js b/packages/desktop-client/src/components/BankSyncStatus.js
index dddc3fc..1387516 100644
--- a/packages/desktop-client/src/components/BankSyncStatus.js
+++ b/packages/desktop-client/src/components/BankSyncStatus.js
@@ -1,9 +1,11 @@
import React from 'react';
import { connect } from 'react-redux';
import { useTransition, animated } from 'react-spring';
+
import * as actions from 'loot-core/src/client/actions';
import { View, Text } from 'loot-design/src/components/common';
import { colors, styles } from 'loot-design/src/style';
+
import AnimatedRefresh from './AnimatedRefresh';
function BankSyncStatus({ accountsSyncing }) {
diff --git a/packages/desktop-client/src/components/Debugger.js b/packages/desktop-client/src/components/Debugger.js
index 770ab6b..de887c3 100644
--- a/packages/desktop-client/src/components/Debugger.js
+++ b/packages/desktop-client/src/components/Debugger.js
@@ -1,10 +1,12 @@
import React from 'react';
+
+import CodeMirror from 'codemirror';
+
+import * as spreadsheet from 'loot-core/src/client/sheetql/spreadsheet';
import {
send,
init as initConnection
} from 'loot-core/src/platform/client/fetch';
-import * as spreadsheet from 'loot-core/src/client/sheetql/spreadsheet';
-import CodeMirror from 'codemirror';
import {
View,
Button,
diff --git a/packages/desktop-client/src/components/FatalError.js b/packages/desktop-client/src/components/FatalError.js
index 48dd267..6666c86 100644
--- a/packages/desktop-client/src/components/FatalError.js
+++ b/packages/desktop-client/src/components/FatalError.js
@@ -1,4 +1,5 @@
import React from 'react';
+
import {
View,
Stack,
diff --git a/packages/desktop-client/src/components/FinancesApp.js b/packages/desktop-client/src/components/FinancesApp.js
index f28507d..eccbab1 100644
--- a/packages/desktop-client/src/components/FinancesApp.js
+++ b/packages/desktop-client/src/components/FinancesApp.js
@@ -1,40 +1,41 @@
import React, { useMemo } from 'react';
-import { Router, Route, Redirect, Switch, useLocation } from 'react-router-dom';
-import { createBrowserHistory } from 'history';
-import { connect } from 'react-redux';
import { DndProvider } from 'react-dnd';
import Backend from 'react-dnd-html5-backend';
+import { connect } from 'react-redux';
+import { Router, Route, Redirect, Switch, useLocation } from 'react-router-dom';
+
+import { createBrowserHistory } from 'history';
import hotkeys from 'hotkeys-js';
+
import * as actions from 'loot-core/src/client/actions';
+import { AccountsProvider } from 'loot-core/src/client/data-hooks/accounts';
+import { PayeesProvider } from 'loot-core/src/client/data-hooks/payees';
import { SpreadsheetProvider } from 'loot-core/src/client/SpreadsheetProvider';
import checkForUpgradeNotifications from 'loot-core/src/client/upgrade-notifications';
-import { colors } from 'loot-design/src/style';
-import { View } from 'loot-design/src/components/common';
-import { BudgetMonthCountProvider } from 'loot-design/src/components/budget/BudgetMonthCountContext';
import * as undo from 'loot-core/src/platform/client/undo';
-import { PayeesProvider } from 'loot-core/src/client/data-hooks/payees';
-import { AccountsProvider } from 'loot-core/src/client/data-hooks/accounts';
-import { getLocationState } from '../util/location-state';
-import { makeLocationState } from '../util/location-state';
-import { PageTypeProvider } from './Page';
+import { BudgetMonthCountProvider } from 'loot-design/src/components/budget/BudgetMonthCountContext';
+import { View } from 'loot-design/src/components/common';
+import { colors } from 'loot-design/src/style';
+
+import { getLocationState, makeLocationState } from '../util/location-state';
+import Account from './accounts/Account';
import { ActiveLocationProvider } from './ActiveLocation';
import BankSyncStatus from './BankSyncStatus';
-
-import Titlebar, { TitlebarProvider } from './Titlebar';
-import FloatableSidebar, { SidebarProvider } from './FloatableSidebar';
-import Account from './accounts/Account';
import Budget from './budget';
-import Reports from './reports';
-import Schedules from './schedules';
-import EditSchedule from './schedules/EditSchedule';
-import LinkSchedule from './schedules/LinkSchedule';
-import DiscoverSchedules from './schedules/DiscoverSchedules';
-import PostsOfflineNotification from './schedules/PostsOfflineNotification';
-import FixSplitsTool from './tools/FixSplitsTool';
-import Settings from './Settings';
+import FloatableSidebar, { SidebarProvider } from './FloatableSidebar';
+import GlobalKeys from './GlobalKeys';
import Modals from './Modals';
import Notifications from './Notifications';
-import GlobalKeys from './GlobalKeys';
+import { PageTypeProvider } from './Page';
+import Reports from './reports';
+import Schedules from './schedules';
+import DiscoverSchedules from './schedules/DiscoverSchedules';
+import EditSchedule from './schedules/EditSchedule';
+import LinkSchedule from './schedules/LinkSchedule';
+import PostsOfflineNotification from './schedules/PostsOfflineNotification';
+import Settings from './Settings';
+import Titlebar, { TitlebarProvider } from './Titlebar';
+import FixSplitsTool from './tools/FixSplitsTool';
// import Debugger from './Debugger';
function URLBar() {
diff --git a/packages/desktop-client/src/components/FloatableSidebar.js b/packages/desktop-client/src/components/FloatableSidebar.js
index 3d676f2..a272c61 100644
--- a/packages/desktop-client/src/components/FloatableSidebar.js
+++ b/packages/desktop-client/src/components/FloatableSidebar.js
@@ -1,7 +1,9 @@
import React, { useState, useEffect, useContext } from 'react';
import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom';
+
import mitt from 'mitt';
+
import * as actions from 'loot-core/src/client/actions';
import { View } from 'loot-design/src/components/common';
import { SIDEBAR_WIDTH } from 'loot-design/src/components/sidebar';
diff --git a/packages/desktop-client/src/components/GlobalKeys.js b/packages/desktop-client/src/components/GlobalKeys.js
index 08d3ad8..0b38966 100644
--- a/packages/desktop-client/src/components/GlobalKeys.js
+++ b/packages/desktop-client/src/components/GlobalKeys.js
@@ -1,5 +1,6 @@
import React from 'react';
import { withRouter } from 'react-router-dom';
+
import Platform from 'loot-core/src/client/platform';
class GlobalKeys extends React.Component {
diff --git a/packages/desktop-client/src/components/LoggedInUser.js b/packages/desktop-client/src/components/LoggedInUser.js
index 46d472f..c02a23c 100644
--- a/packages/desktop-client/src/components/LoggedInUser.js
+++ b/packages/desktop-client/src/components/LoggedInUser.js
@@ -1,6 +1,7 @@
import React, { useState, useEffect } from 'react';
import { connect } from 'react-redux';
import { withRouter } from 'react-router';
+
import * as actions from 'loot-core/src/client/actions';
import {
View,
diff --git a/packages/desktop-client/src/components/MobileWebMessage.js b/packages/desktop-client/src/components/MobileWebMessage.js
index ad0666a..cca240e 100644
--- a/packages/desktop-client/src/components/MobileWebMessage.js
+++ b/packages/desktop-client/src/components/MobileWebMessage.js
@@ -1,4 +1,5 @@
import React, { useState } from 'react';
+
import {
View,
Text,
diff --git a/packages/desktop-client/src/components/Modals.js b/packages/desktop-client/src/components/Modals.js
index 5e756bb..2dc967f 100644
--- a/packages/desktop-client/src/components/Modals.js
+++ b/packages/desktop-client/src/components/Modals.js
@@ -1,29 +1,31 @@
import React from 'react';
-import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import { Route, Switch } from 'react-router-dom';
-import { createLocation } from 'history';
+
import Component from '@reactions/component';
+import { createLocation } from 'history';
+import { bindActionCreators } from 'redux';
+
import * as actions from 'loot-core/src/client/actions';
import { send, listen, unlisten } from 'loot-core/src/platform/client/fetch';
-
-import CreateLocalAccount from 'loot-design/src/components/modals/CreateLocalAccount';
import CloseAccount from 'loot-design/src/components/modals/CloseAccount';
-import SelectLinkedAccounts from 'loot-design/src/components/modals/SelectLinkedAccounts';
import ConfigureLinkedAccounts from 'loot-design/src/components/modals/ConfigureLinkedAccounts';
+import CreateLocalAccount from 'loot-design/src/components/modals/CreateLocalAccount';
+import EditField from 'loot-design/src/components/modals/EditField';
+import ImportTransactions from 'loot-design/src/components/modals/ImportTransactions';
import LoadBackup from 'loot-design/src/components/modals/LoadBackup';
import PlaidExternalMsg from 'loot-design/src/components/modals/PlaidExternalMsg';
-import ImportTransactions from 'loot-design/src/components/modals/ImportTransactions';
-import EditField from 'loot-design/src/components/modals/EditField';
-import CreateAccount from './modals/CreateAccount';
-import ManagePayeesWithData from './payees/ManagePayeesWithData';
-import ManageRules from './modals/ManageRules';
-import EditRule from './modals/EditRule';
-import MergeUnusedPayees from './modals/MergeUnusedPayees';
+import SelectLinkedAccounts from 'loot-design/src/components/modals/SelectLinkedAccounts';
+
import ConfirmCategoryDelete from './modals/ConfirmCategoryDelete';
-import WelcomeScreen from './modals/WelcomeScreen';
+import CreateAccount from './modals/CreateAccount';
import CreateEncryptionKey from './modals/CreateEncryptionKey';
+import EditRule from './modals/EditRule';
import FixEncryptionKey from './modals/FixEncryptionKey';
+import ManageRules from './modals/ManageRules';
+import MergeUnusedPayees from './modals/MergeUnusedPayees';
+import WelcomeScreen from './modals/WelcomeScreen';
+import ManagePayeesWithData from './payees/ManagePayeesWithData';
function Modals({
history,
diff --git a/packages/desktop-client/src/components/Notifications.js b/packages/desktop-client/src/components/Notifications.js
index ff03df4..c8ae15c 100644
--- a/packages/desktop-client/src/components/Notifications.js
+++ b/packages/desktop-client/src/components/Notifications.js
@@ -1,6 +1,8 @@
import React, { useState, useEffect, useMemo } from 'react';
-import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
+
+import { bindActionCreators } from 'redux';
+
import * as actions from 'loot-core/src/client/actions';
import {
View,
@@ -10,9 +12,9 @@ import {
Stack,
ExternalLink
} from 'loot-design/src/components/common';
+import { styles, colors } from 'loot-design/src/style';
import Delete from 'loot-design/src/svg/Delete';
import Loading from 'loot-design/src/svg/v1/AnimatedLoading';
-import { styles, colors } from 'loot-design/src/style';
function compileMessage(message, actions, setLoading, onRemove) {
return (
diff --git a/packages/desktop-client/src/components/Page.js b/packages/desktop-client/src/components/Page.js
index 757993d..f18332d 100644
--- a/packages/desktop-client/src/components/Page.js
+++ b/packages/desktop-client/src/components/Page.js
@@ -1,5 +1,6 @@
import React from 'react';
import { useHistory } from 'react-router-dom';
+
import { Modal, View, Text } from 'loot-design/src/components/common';
import { styles } from 'loot-design/src/style';
diff --git a/packages/desktop-client/src/components/Settings.js b/packages/desktop-client/src/components/Settings.js
index e9c9a68..616daca 100644
--- a/packages/desktop-client/src/components/Settings.js
+++ b/packages/desktop-client/src/components/Settings.js
@@ -1,8 +1,14 @@
import React, { useState, useEffect, useRef } from 'react';
import { connect } from 'react-redux';
-import { css } from 'glamor';
import { Route, Switch, Redirect } from 'react-router-dom';
+
+import { css } from 'glamor';
+
import * as actions from 'loot-core/src/client/actions';
+import Platform from 'loot-core/src/client/platform';
+import { send, listen } from 'loot-core/src/platform/client/fetch';
+import { numberFormats } from 'loot-core/src/shared/util';
+import { Information } from 'loot-design/src/components/alerts';
import {
View,
Text,
@@ -10,12 +16,8 @@ import {
ButtonWithLoading,
AnchorLink
} from 'loot-design/src/components/common';
-import { send, listen } from 'loot-core/src/platform/client/fetch';
-import { numberFormats } from 'loot-core/src/shared/util';
import { styles, colors } from 'loot-design/src/style';
-import { Information } from 'loot-design/src/components/alerts';
import ExpandArrow from 'loot-design/src/svg/ExpandArrow';
-import Platform from 'loot-core/src/client/platform';
import useServerVersion from '../hooks/useServerVersion';
diff --git a/packages/desktop-client/src/components/SidebarWithData.js b/packages/desktop-client/src/components/SidebarWithData.js
index eeaa5e2..0c35a02 100644
--- a/packages/desktop-client/src/components/SidebarWithData.js
+++ b/packages/desktop-client/src/components/SidebarWithData.js
@@ -1,9 +1,12 @@
import React, { useState, useEffect } from 'react';
-import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom';
+
+import { bindActionCreators } from 'redux';
+
+import * as actions from 'loot-core/src/client/actions';
+import * as queries from 'loot-core/src/client/queries';
import { send } from 'loot-core/src/platform/client/fetch';
-import { styles, colors } from 'loot-design/src/style';
import {
Button,
Input,
@@ -11,8 +14,7 @@ import {
Text
} from 'loot-design/src/components/common';
import { Sidebar } from 'loot-design/src/components/sidebar';
-import * as actions from 'loot-core/src/client/actions';
-import * as queries from 'loot-core/src/client/queries';
+import { styles, colors } from 'loot-design/src/style';
function EditableBudgetName({ prefs, savePrefs }) {
const [editing, setEditing] = useState(false);
diff --git a/packages/desktop-client/src/components/SpreadsheetInterface.js b/packages/desktop-client/src/components/SpreadsheetInterface.js
index 856ddc6..d21e32c 100644
--- a/packages/desktop-client/src/components/SpreadsheetInterface.js
+++ b/packages/desktop-client/src/components/SpreadsheetInterface.js
@@ -1,6 +1,7 @@
import React from 'react';
-import Cell from 'loot-design/src/components/spreadsheet/Cell';
+
import { View } from 'loot-design/src/components/common';
+import Cell from 'loot-design/src/components/spreadsheet/Cell';
function SpreadsheetInterface() {
return (
diff --git a/packages/desktop-client/src/components/Titlebar.js b/packages/desktop-client/src/components/Titlebar.js
index b96d5a9..c0b807c 100644
--- a/packages/desktop-client/src/components/Titlebar.js
+++ b/packages/desktop-client/src/components/Titlebar.js
@@ -1,11 +1,11 @@
import React, { useState, useEffect, useRef, useContext } from 'react';
-import { Switch, Route, withRouter } from 'react-router-dom';
import { connect } from 'react-redux';
+import { Switch, Route, withRouter } from 'react-router-dom';
+
import * as actions from 'loot-core/src/client/actions';
+import Platform from 'loot-core/src/client/platform';
import * as queries from 'loot-core/src/client/queries';
import { listen } from 'loot-core/src/platform/client/fetch';
-import Platform from 'loot-core/src/client/platform';
-import { colors } from 'loot-design/src/style';
import {
View,
Text,
@@ -16,15 +16,17 @@ import {
P
} from 'loot-design/src/components/common';
import SheetValue from 'loot-design/src/components/spreadsheet/SheetValue';
-import ArrowButtonRight1 from 'loot-design/src/svg/v2/ArrowButtonRight1';
-import NavigationMenu from 'loot-design/src/svg/v2/NavigationMenu';
+import { colors } from 'loot-design/src/style';
import ArrowLeft from 'loot-design/src/svg/v1/ArrowLeft';
import AlertTriangle from 'loot-design/src/svg/v2/AlertTriangle';
-import { MonthCountSelector } from './budget/MonthCountSelector';
+import ArrowButtonRight1 from 'loot-design/src/svg/v2/ArrowButtonRight1';
+import NavigationMenu from 'loot-design/src/svg/v2/NavigationMenu';
+
import AccountSyncCheck from './accounts/AccountSyncCheck';
-import LoggedInUser from './LoggedInUser';
import AnimatedRefresh from './AnimatedRefresh';
+import { MonthCountSelector } from './budget/MonthCountSelector';
import { useSidebar } from './FloatableSidebar';
+import LoggedInUser from './LoggedInUser';
export let TitlebarContext = React.createContext();
diff --git a/packages/desktop-client/src/components/Tutorial.js b/packages/desktop-client/src/components/Tutorial.js
index aeaa4e3..9f70791 100644
--- a/packages/desktop-client/src/components/Tutorial.js
+++ b/packages/desktop-client/src/components/Tutorial.js
@@ -1,20 +1,23 @@
import React from 'react';
import ReactDOM from 'react-dom';
+import { connect } from 'react-redux';
+
import PropTypes from 'prop-types';
import { bindActionCreators } from 'redux';
-import { connect } from 'react-redux';
+
import * as actions from 'loot-core/src/client/actions';
-import Intro from './tutorial/Intro';
-import BudgetSummary from './tutorial/BudgetSummary';
+
import BudgetCategories from './tutorial/BudgetCategories';
import BudgetInitial from './tutorial/BudgetInitial';
+import BudgetNewIncome from './tutorial/BudgetNewIncome';
+import BudgetNextMonth from './tutorial/BudgetNextMonth';
+import BudgetSummary from './tutorial/BudgetSummary';
+import CategoryBalance from './tutorial/CategoryBalance';
+import Final from './tutorial/Final';
+import Intro from './tutorial/Intro';
+import Overspending from './tutorial/Overspending';
import TransactionAdd from './tutorial/TransactionAdd';
import TransactionEnter from './tutorial/TransactionEnter';
-import BudgetNewIncome from './tutorial/BudgetNewIncome';
-import CategoryBalance from './tutorial/CategoryBalance';
-import Overspending from './tutorial/Overspending';
-import BudgetNextMonth from './tutorial/BudgetNextMonth';
-import Final from './tutorial/Final';
function generatePath(innerRect, outerRect) {
const i = innerRect;
diff --git a/packages/desktop-client/src/components/TutorialPoints.js b/packages/desktop-client/src/components/TutorialPoints.js
index 91ed03a..f7027e1 100644
--- a/packages/desktop-client/src/components/TutorialPoints.js
+++ b/packages/desktop-client/src/components/TutorialPoints.js
@@ -1,5 +1,6 @@
import React from 'react';
import { connect } from 'react-redux';
+
import PropTypes from 'prop-types';
class Tutorial extends React.Component {
diff --git a/packages/desktop-client/src/components/UpdateNotification.js b/packages/desktop-client/src/components/UpdateNotification.js
index a2af5e8..5804946 100644
--- a/packages/desktop-client/src/components/UpdateNotification.js
+++ b/packages/desktop-client/src/components/UpdateNotification.js
@@ -1,6 +1,8 @@
import React from 'react';
-import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
+
+import { bindActionCreators } from 'redux';
+
import * as actions from 'loot-core/src/client/actions';
import { View, Text, Link, Button } from 'loot-design/src/components/common';
import { colors } from 'loot-design/src/style';
diff --git a/packages/desktop-client/src/components/accounts/Account.js b/packages/desktop-client/src/components/accounts/Account.js
index 85a66f2..0719e71 100644
--- a/packages/desktop-client/src/components/accounts/Account.js
+++ b/packages/desktop-client/src/components/accounts/Account.js
@@ -1,11 +1,29 @@
import React, { useState, useEffect, useRef, useMemo } from 'react';
import { Trans, useTranslation } from 'react-i18next';
-import { bindActionCreators } from 'redux';
import { useSelector, useDispatch } from 'react-redux';
import { Redirect, useParams, useHistory, useLocation } from 'react-router-dom';
+
import { debounce } from 'debounce';
-import { send, listen } from 'loot-core/src/platform/client/fetch';
+import { bindActionCreators } from 'redux';
+
import * as actions from 'loot-core/src/client/actions';
+import {
+ SchedulesProvider,
+ useCachedSchedules
+} from 'loot-core/src/client/data-hooks/schedules';
+import * as queries from 'loot-core/src/client/queries';
+import q, { runQuery, pagedQuery } from 'loot-core/src/client/query-helpers';
+import { send, listen } from 'loot-core/src/platform/client/fetch';
+import {
+ deleteTransaction,
+ updateTransaction,
+ ungroupTransactions
+} from 'loot-core/src/shared/transactions';
+import {
+ currencyToInteger,
+ applyChanges,
+ groupById
+} from 'loot-core/src/shared/util';
import {
View,
Text,
@@ -17,45 +35,30 @@ import {
Menu,
Stack
} from 'loot-design/src/components/common';
-import {
- currencyToInteger,
- applyChanges,
- groupById
-} from 'loot-core/src/shared/util';
-import DotsHorizontalTriple from 'loot-design/src/svg/v1/DotsHorizontalTriple';
-import Pencil1 from 'loot-design/src/svg/v2/Pencil1';
-import SearchAlternate from 'loot-design/src/svg/v2/SearchAlternate';
-import DownloadThickBottom from 'loot-design/src/svg/v2/DownloadThickBottom';
-import Add from 'loot-design/src/svg/v1/Add';
+import { KeyHandlers } from 'loot-design/src/components/KeyHandlers';
+import CellValue from 'loot-design/src/components/spreadsheet/CellValue';
import format from 'loot-design/src/components/spreadsheet/format';
import useSheetValue from 'loot-design/src/components/spreadsheet/useSheetValue';
-import CellValue from 'loot-design/src/components/spreadsheet/CellValue';
-import ArrowButtonRight1 from 'loot-design/src/svg/v2/ArrowButtonRight1';
-import CheckCircle1 from 'loot-design/src/svg/v2/CheckCircle1';
-import Loading from 'loot-design/src/svg/v1/AnimatedLoading';
-import ArrowsExpand3 from 'loot-design/src/svg/v2/ArrowsExpand3';
-import ArrowsShrink3 from 'loot-design/src/svg/v2/ArrowsShrink3';
-import * as queries from 'loot-core/src/client/queries';
-import q, { runQuery, pagedQuery } from 'loot-core/src/client/query-helpers';
import { SelectedItemsButton } from 'loot-design/src/components/table';
-import {
- deleteTransaction,
- updateTransaction,
- ungroupTransactions
-} from 'loot-core/src/shared/transactions';
-import { styles, colors } from 'loot-design/src/style';
import {
SelectedProviderWithItems,
useSelectedItems
} from 'loot-design/src/components/useSelected';
-import { KeyHandlers } from 'loot-design/src/components/KeyHandlers';
-import {
- SchedulesProvider,
- useCachedSchedules
-} from 'loot-core/src/client/data-hooks/schedules';
+import { styles, colors } from 'loot-design/src/style';
+import Add from 'loot-design/src/svg/v1/Add';
+import Loading from 'loot-design/src/svg/v1/AnimatedLoading';
+import DotsHorizontalTriple from 'loot-design/src/svg/v1/DotsHorizontalTriple';
+import ArrowButtonRight1 from 'loot-design/src/svg/v2/ArrowButtonRight1';
+import ArrowsExpand3 from 'loot-design/src/svg/v2/ArrowsExpand3';
+import ArrowsShrink3 from 'loot-design/src/svg/v2/ArrowsShrink3';
+import CheckCircle1 from 'loot-design/src/svg/v2/CheckCircle1';
+import DownloadThickBottom from 'loot-design/src/svg/v2/DownloadThickBottom';
+import Pencil1 from 'loot-design/src/svg/v2/Pencil1';
+import SearchAlternate from 'loot-design/src/svg/v2/SearchAlternate';
+
import { authorizeBank } from '../../plaid';
-import AnimatedRefresh from '../AnimatedRefresh';
import { useActiveLocation } from '../ActiveLocation';
+import AnimatedRefresh from '../AnimatedRefresh';
import { FilterButton, AppliedFilters } from './Filters';
import TransactionList from './TransactionList';
import {
diff --git a/packages/desktop-client/src/components/accounts/AccountSyncCheck.js b/packages/desktop-client/src/components/accounts/AccountSyncCheck.js
index d32311e..04d25b1 100644
--- a/packages/desktop-client/src/components/accounts/AccountSyncCheck.js
+++ b/packages/desktop-client/src/components/accounts/AccountSyncCheck.js
@@ -1,9 +1,11 @@
import React, { useState } from 'react';
import { connect } from 'react-redux';
+
import * as actions from 'loot-core/src/client/actions';
import { View, Button, Tooltip } from 'loot-design/src/components/common';
-import ExclamationOutline from 'loot-design/src/svg/v1/ExclamationOutline';
import { colors } from 'loot-design/src/style';
+import ExclamationOutline from 'loot-design/src/svg/v1/ExclamationOutline';
+
import { reauthorizeBank } from '../../plaid';
function getErrorMessage(type, code) {
diff --git a/packages/desktop-client/src/components/accounts/Filters.js b/packages/desktop-client/src/components/accounts/Filters.js
index e39a9cd..d366dd6 100644
--- a/packages/desktop-client/src/components/accounts/Filters.js
+++ b/packages/desktop-client/src/components/accounts/Filters.js
@@ -1,23 +1,15 @@
import React, { useState, useRef, useEffect, useReducer } from 'react';
import { useSelector } from 'react-redux';
-import scopeTab from 'react-modal/lib/helpers/scopeTab';
+
import {
parse as parseDate,
format as formatDate,
isValid as isDateValid
} from 'date-fns';
+import scopeTab from 'react-modal/lib/helpers/scopeTab';
+
import { send } from 'loot-core/src/platform/client/fetch';
import { getMonthYearFormat } from 'loot-core/src/shared/months';
-import { titleFirst } from 'loot-core/src/shared/util';
-import {
- View,
- Text,
- Tooltip,
- Stack,
- Button,
- Menu,
- CustomSelect
-} from 'loot-design/src/components/common';
import {
mapField,
friendlyOp,
@@ -28,11 +20,22 @@ import {
FIELD_TYPES,
TYPE_INFO
} from 'loot-core/src/shared/rules';
+import { titleFirst } from 'loot-core/src/shared/util';
+import {
+ View,
+ Text,
+ Tooltip,
+ Stack,
+ Button,
+ Menu,
+ CustomSelect
+} from 'loot-design/src/components/common';
+import { colors } from 'loot-design/src/style';
import DeleteIcon from 'loot-design/src/svg/Delete';
import SettingsSliderAlternate from 'loot-design/src/svg/v2/SettingsSliderAlternate';
-import { colors } from 'loot-design/src/style';
-import GenericInput from '../util/GenericInput';
+
import { Value } from '../modals/ManageRules';
+import GenericInput from '../util/GenericInput';
let filterFields = [
'date',
diff --git a/packages/desktop-client/src/components/accounts/SimpleTransactionsTable.js b/packages/desktop-client/src/components/accounts/SimpleTransactionsTable.js
index ea84192..819b3ca 100644
--- a/packages/desktop-client/src/components/accounts/SimpleTransactionsTable.js
+++ b/packages/desktop-client/src/components/accounts/SimpleTransactionsTable.js
@@ -1,10 +1,17 @@
import React, { useMemo, useCallback } from 'react';
import { useSelector } from 'react-redux';
+
import {
format as formatDate,
parseISO,
isValid as isDateValid
} from 'date-fns';
+
+import {
+ getAccountsById,
+ getCategoriesById
+} from 'loot-core/src/client/reducers/queries';
+import { integerToCurrency } from 'loot-core/src/shared/util';
import {
Table,
Row,
@@ -16,13 +23,9 @@ import {
useSelectedItems,
useSelectedDispatch
} from 'loot-design/src/components/useSelected';
-import { integerToCurrency } from 'loot-core/src/shared/util';
-import {
- getAccountsById,
- getCategoriesById
-} from 'loot-core/src/client/reducers/queries';
-import ArrowsSynchronize from 'loot-design/src/svg/v2/ArrowsSynchronize';
import { styles } from 'loot-design/src/style';
+import ArrowsSynchronize from 'loot-design/src/svg/v2/ArrowsSynchronize';
+
import DisplayId from '../util/DisplayId';
function serializeTransaction(transaction, dateFormat) {
diff --git a/packages/desktop-client/src/components/accounts/TransactionList.js b/packages/desktop-client/src/components/accounts/TransactionList.js
index a07c31f..8e2f16b 100644
--- a/packages/desktop-client/src/components/accounts/TransactionList.js
+++ b/packages/desktop-client/src/components/accounts/TransactionList.js
@@ -1,5 +1,7 @@
import React, { useRef, useEffect, useCallback, useLayoutEffect } from 'react';
import { useDispatch } from 'react-redux';
+
+import { send } from 'loot-core/src/platform/client/fetch';
import {
splitTransaction,
updateTransaction,
@@ -7,9 +9,10 @@ import {
realizeTempTransactions,
applyTransactionDiff
} from 'loot-core/src/shared/transactions';
-import { send } from 'loot-core/src/platform/client/fetch';
import { getChangedValues, applyChanges } from 'loot-core/src/shared/util';
+
import { TransactionTable } from './TransactionsTable';
+
const uuid = require('loot-core/src/platform/uuid');
// When data changes, there are two ways to update the UI:
diff --git a/packages/desktop-client/src/components/accounts/TransactionsTable.js b/packages/desktop-client/src/components/accounts/TransactionsTable.js
index 9b678e7..3613391 100644
--- a/packages/desktop-client/src/components/accounts/TransactionsTable.js
+++ b/packages/desktop-client/src/components/accounts/TransactionsTable.js
@@ -9,41 +9,38 @@ import React, {
useReducer
} from 'react';
import { useSelector, useDispatch } from 'react-redux';
+
import {
format as formatDate,
parseISO,
isValid as isDateValid
} from 'date-fns';
-import { View, Text, Tooltip, Button } from 'loot-design/src/components/common';
-import CategoryAutocomplete from 'loot-design/src/components/CategorySelect';
-import PayeeAutocomplete from 'loot-design/src/components/PayeeAutocomplete';
-import AccountAutocomplete from 'loot-design/src/components/AccountAutocomplete';
-import DateSelect from 'loot-design/src/components/DateSelect';
-import RightArrow2 from 'loot-design/src/svg/RightArrow2';
-import LeftArrow2 from 'loot-design/src/svg/LeftArrow2';
-import Hyperlink2 from 'loot-design/src/svg/v2/Hyperlink2';
-import CheveronDown from 'loot-design/src/svg/v1/CheveronDown';
-import CalendarIcon from 'loot-design/src/svg/v2/Calendar';
-import ArrowsSynchronize from 'loot-design/src/svg/v2/ArrowsSynchronize';
-import {
- integerToCurrency,
- amountToInteger,
- titleFirst
-} from 'loot-core/src/shared/util';
-import evalArithmetic from 'loot-core/src/shared/arithmetic';
+
+import { useCachedSchedules } from 'loot-core/src/client/data-hooks/schedules';
import {
getAccountsById,
getPayeesById,
getCategoriesById
} from 'loot-core/src/client/reducers/queries';
+import evalArithmetic from 'loot-core/src/shared/arithmetic';
import { currentDay } from 'loot-core/src/shared/months';
+import { getScheduledAmount } from 'loot-core/src/shared/schedules';
import {
splitTransaction,
updateTransaction,
deleteTransaction,
addSplitTransaction
} from 'loot-core/src/shared/transactions';
-import { styles, colors } from 'loot-design/src/style';
+import {
+ integerToCurrency,
+ amountToInteger,
+ titleFirst
+} from 'loot-core/src/shared/util';
+import AccountAutocomplete from 'loot-design/src/components/AccountAutocomplete';
+import CategoryAutocomplete from 'loot-design/src/components/CategorySelect';
+import { View, Text, Tooltip, Button } from 'loot-design/src/components/common';
+import DateSelect from 'loot-design/src/components/DateSelect';
+import PayeeAutocomplete from 'loot-design/src/components/PayeeAutocomplete';
import {
Cell,
Field,
@@ -56,13 +53,19 @@ import {
useTableNavigator,
Table
} from 'loot-design/src/components/table';
+import { useMergedRefs } from 'loot-design/src/components/useMergedRefs';
import {
useSelectedDispatch,
useSelectedItems
} from 'loot-design/src/components/useSelected';
-import { useMergedRefs } from 'loot-design/src/components/useMergedRefs';
-import { useCachedSchedules } from 'loot-core/src/client/data-hooks/schedules';
-import { getScheduledAmount } from 'loot-core/src/shared/schedules';
+import { styles, colors } from 'loot-design/src/style';
+import LeftArrow2 from 'loot-design/src/svg/LeftArrow2';
+import RightArrow2 from 'loot-design/src/svg/RightArrow2';
+import CheveronDown from 'loot-design/src/svg/v1/CheveronDown';
+import ArrowsSynchronize from 'loot-design/src/svg/v2/ArrowsSynchronize';
+import CalendarIcon from 'loot-design/src/svg/v2/Calendar';
+import Hyperlink2 from 'loot-design/src/svg/v2/Hyperlink2';
+
import { getStatusProps } from '../schedules/StatusBadge';
let TABLE_BACKGROUND_COLOR = colors.n11;
@@ -1634,7 +1637,8 @@ export let TransactionTable = React.forwardRef((props, ref) => {
onAddSplit(lastTransaction.id);
} else if (
(newNavigator.focusedField === 'debit' ||
- newNavigator.focusedField === 'credit') &&
+ newNavigator.focusedField === 'credit' ||
+ newNavigator.focusedField === 'cleared') &&
newNavigator.editingId === lastTransaction.id &&
(!isSplit || !lastTransaction.error)
) {
diff --git a/packages/desktop-client/src/components/accounts/TransactionsTable.test.js b/packages/desktop-client/src/components/accounts/TransactionsTable.test.js
index eb4a9f3..fef6ec8 100644
--- a/packages/desktop-client/src/components/accounts/TransactionsTable.test.js
+++ b/packages/desktop-client/src/components/accounts/TransactionsTable.test.js
@@ -1,23 +1,27 @@
import React from 'react';
-import { act } from 'react-dom/test-utils';
+
import { render, fireEvent } from '@testing-library/react';
import { format as formatDate, parse as parseDate } from 'date-fns';
-import { integerToCurrency } from 'loot-core/src/shared/util';
-import { initServer } from 'loot-core/src/platform/client/fetch';
+import { act } from 'react-dom/test-utils';
+
import {
generateTransaction,
generateAccount,
generateCategoryGroups,
TestProvider
} from 'loot-core/src/mocks';
+import { initServer } from 'loot-core/src/platform/client/fetch';
import {
addSplitTransaction,
realizeTempTransactions,
splitTransaction,
updateTransaction
} from 'loot-core/src/shared';
+import { integerToCurrency } from 'loot-core/src/shared/util';
import { SelectedProviderWithItems } from 'loot-design/src/components';
+
import { SplitsExpandedProvider, TransactionTable } from './TransactionsTable';
+
const uuid = require('loot-core/src/platform/uuid');
const accounts = [generateAccount('Bank of America')];
diff --git a/packages/desktop-client/src/components/budget/MonthCountSelector.js b/packages/desktop-client/src/components/budget/MonthCountSelector.js
index ce90820..b944948 100644
--- a/packages/desktop-client/src/components/budget/MonthCountSelector.js
+++ b/packages/desktop-client/src/components/budget/MonthCountSelector.js
@@ -1,7 +1,8 @@
import React from 'react';
-import { colors } from 'loot-design/src/style';
-import { View } from 'loot-design/src/components/common';
+
import { useBudgetMonthCount } from 'loot-design/src/components/budget/BudgetMonthCountContext';
+import { View } from 'loot-design/src/components/common';
+import { colors } from 'loot-design/src/style';
import CalendarIcon from 'loot-design/src/svg/v2/Calendar';
function Calendar({ color, onClick }) {
diff --git a/packages/desktop-client/src/components/budget/index.js b/packages/desktop-client/src/components/budget/index.js
index b1d862d..5a73395 100644
--- a/packages/desktop-client/src/components/budget/index.js
+++ b/packages/desktop-client/src/components/budget/index.js
@@ -1,20 +1,8 @@
import React, { useContext, useMemo } from 'react';
import { connect } from 'react-redux';
+
import * as actions from 'loot-core/src/client/actions';
import { send, listen } from 'loot-core/src/platform/client/fetch';
-import * as monthUtils from 'loot-core/src/shared/months';
-import { getValidMonthBounds } from 'loot-design/src/components/budget/MonthsContext';
-
-import * as rollover from 'loot-design/src/components/budget/rollover/rollover-components';
-import { RolloverContext } from 'loot-design/src/components/budget/rollover/RolloverContext';
-
-import * as report from 'loot-design/src/components/budget/report/components';
-import { ReportProvider } from 'loot-design/src/components/budget/report/ReportContext';
-
-import DynamicBudgetTable from 'loot-design/src/components/budget/DynamicBudgetTable';
-import SpreadsheetContext from 'loot-design/src/components/spreadsheet/SpreadsheetContext';
-import { View } from 'loot-design/src/components/common';
-import { styles } from 'loot-design/src/style';
import {
addCategory,
updateCategory,
@@ -25,6 +13,17 @@ import {
updateGroup,
deleteGroup
} from 'loot-core/src/shared/categories.js';
+import * as monthUtils from 'loot-core/src/shared/months';
+import DynamicBudgetTable from 'loot-design/src/components/budget/DynamicBudgetTable';
+import { getValidMonthBounds } from 'loot-design/src/components/budget/MonthsContext';
+import * as report from 'loot-design/src/components/budget/report/components';
+import { ReportProvider } from 'loot-design/src/components/budget/report/ReportContext';
+import * as rollover from 'loot-design/src/components/budget/rollover/rollover-components';
+import { RolloverContext } from 'loot-design/src/components/budget/rollover/RolloverContext';
+import { View } from 'loot-design/src/components/common';
+import SpreadsheetContext from 'loot-design/src/components/spreadsheet/SpreadsheetContext';
+import { styles } from 'loot-design/src/style';
+
import { TitlebarContext } from '../Titlebar';
let _initialBudgetMonth = null;
diff --git a/packages/desktop-client/src/components/debug/index.js b/packages/desktop-client/src/components/debug/index.js
index f7419d8..9270c49 100644
--- a/packages/desktop-client/src/components/debug/index.js
+++ b/packages/desktop-client/src/components/debug/index.js
@@ -1,5 +1,7 @@
import React from 'react';
+
import styled from 'styled-components';
+
import { send } from 'loot-core/src/platform/client/fetch';
const Container = styled.div`
diff --git a/packages/desktop-client/src/components/manager/ConfigServer.js b/packages/desktop-client/src/components/manager/ConfigServer.js
index b9380b0..9ab0660 100644
--- a/packages/desktop-client/src/components/manager/ConfigServer.js
+++ b/packages/desktop-client/src/components/manager/ConfigServer.js
@@ -1,6 +1,9 @@
import React, { useState, useEffect } from 'react';
import { useDispatch } from 'react-redux';
import { useHistory } from 'react-router-dom';
+
+import { signOut, loggedIn } from 'loot-core/src/client/actions/user';
+import { send } from 'loot-core/src/platform/client/fetch';
import {
View,
Text,
@@ -8,8 +11,7 @@ import {
ButtonWithLoading
} from 'loot-design/src/components/common';
import { colors } from 'loot-design/src/style';
-import { signOut, loggedIn } from 'loot-core/src/client/actions/user';
-import { send } from 'loot-core/src/platform/client/fetch';
+
import { Title, Input } from './subscribe/common';
export default function ConfigServer() {
diff --git a/packages/desktop-client/src/components/manager/ManagementApp.js b/packages/desktop-client/src/components/manager/ManagementApp.js
index 7d574c7..f053515 100644
--- a/packages/desktop-client/src/components/manager/ManagementApp.js
+++ b/packages/desktop-client/src/components/manager/ManagementApp.js
@@ -1,21 +1,23 @@
import React from 'react';
import { connect } from 'react-redux';
-import { createBrowserHistory } from 'history';
import { Switch, Redirect, Router, Route } from 'react-router-dom';
+
+import { createBrowserHistory } from 'history';
+
import * as actions from 'loot-core/src/client/actions';
import { View, Text } from 'loot-design/src/components/common';
import { colors } from 'loot-design/src/style';
+
+import useServerVersion from '../../hooks/useServerVersion';
import LoggedInUser from '../LoggedInUser';
import Notifications from '../Notifications';
-import useServerVersion from '../../hooks/useServerVersion';
-import ServerURL from './ServerURL';
-
-import Modals from './Modals';
-import Login from './subscribe/Login';
-import Bootstrap from './subscribe/Bootstrap';
-import Error from './subscribe/Error';
-import ChangePassword from './subscribe/ChangePassword';
import ConfigServer from './ConfigServer';
+import Modals from './Modals';
+import ServerURL from './ServerURL';
+import Bootstrap from './subscribe/Bootstrap';
+import ChangePassword from './subscribe/ChangePassword';
+import Error from './subscribe/Error';
+import Login from './subscribe/Login';
function Version() {
const version = useServerVersion();
diff --git a/packages/desktop-client/src/components/manager/Modals.js b/packages/desktop-client/src/components/manager/Modals.js
index e45b1ec..e5f1a5d 100644
--- a/packages/desktop-client/src/components/manager/Modals.js
+++ b/packages/desktop-client/src/components/manager/Modals.js
@@ -1,17 +1,20 @@
import React from 'react';
-import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
+
import Component from '@reactions/component';
-import { send } from 'loot-core/src/platform/client/fetch';
+import { bindActionCreators } from 'redux';
+
import * as actions from 'loot-core/src/client/actions';
+import { send } from 'loot-core/src/platform/client/fetch';
import { View } from 'loot-design/src/components/common';
import BudgetList from 'loot-design/src/components/manager/BudgetList';
-import LoadBackup from 'loot-design/src/components/modals/LoadBackup';
+import DeleteFile from 'loot-design/src/components/manager/DeleteFile';
import Import from 'loot-design/src/components/manager/Import';
+import ImportActual from 'loot-design/src/components/manager/ImportActual';
import ImportYNAB4 from 'loot-design/src/components/manager/ImportYNAB4';
import ImportYNAB5 from 'loot-design/src/components/manager/ImportYNAB5';
-import ImportActual from 'loot-design/src/components/manager/ImportActual';
-import DeleteFile from 'loot-design/src/components/manager/DeleteFile';
+import LoadBackup from 'loot-design/src/components/modals/LoadBackup';
+
import CreateEncryptionKey from '../modals/CreateEncryptionKey';
import FixEncryptionKey from '../modals/FixEncryptionKey';
diff --git a/packages/desktop-client/src/components/manager/ServerURL.js b/packages/desktop-client/src/components/manager/ServerURL.js
index c1ba72f..16a8db2 100644
--- a/packages/desktop-client/src/components/manager/ServerURL.js
+++ b/packages/desktop-client/src/components/manager/ServerURL.js
@@ -1,6 +1,7 @@
import React, { useState, useEffect } from 'react';
-import { View, Text, AnchorLink } from 'loot-design/src/components/common';
+
import { send } from 'loot-core/src/platform/client/fetch';
+import { View, Text, AnchorLink } from 'loot-design/src/components/common';
export default function ServerURL() {
let [url, setUrl] = useState(null);
diff --git a/packages/desktop-client/src/components/manager/subscribe/Bootstrap.js b/packages/desktop-client/src/components/manager/subscribe/Bootstrap.js
index e7f67f5..9c9c956 100644
--- a/packages/desktop-client/src/components/manager/subscribe/Bootstrap.js
+++ b/packages/desktop-client/src/components/manager/subscribe/Bootstrap.js
@@ -1,14 +1,16 @@
import React, { useState } from 'react';
+import { useTranslation } from 'react-i18next';
import { useDispatch } from 'react-redux';
import { useHistory } from 'react-router-dom';
+
+import { createBudget } from 'loot-core/src/client/actions/budgets';
+import { loggedIn } from 'loot-core/src/client/actions/user';
+import { send } from 'loot-core/src/platform/client/fetch';
import { View, Text, Button } from 'loot-design/src/components/common';
import { colors } from 'loot-design/src/style';
-import { loggedIn } from 'loot-core/src/client/actions/user';
-import { createBudget } from 'loot-core/src/client/actions/budgets';
-import { send } from 'loot-core/src/platform/client/fetch';
-import { ConfirmPasswordForm } from './ConfirmPasswordForm';
+
import { useBootstrapped, Title } from './common';
-import { useTranslation } from 'react-i18next';
+import { ConfirmPasswordForm } from './ConfirmPasswordForm';
export default function Bootstrap() {
const { t } = useTranslation();
diff --git a/packages/desktop-client/src/components/manager/subscribe/ChangePassword.js b/packages/desktop-client/src/components/manager/subscribe/ChangePassword.js
index 60daf23..abda7d4 100644
--- a/packages/desktop-client/src/components/manager/subscribe/ChangePassword.js
+++ b/packages/desktop-client/src/components/manager/subscribe/ChangePassword.js
@@ -1,11 +1,13 @@
import React, { useState } from 'react';
import { useDispatch } from 'react-redux';
import { useHistory } from 'react-router-dom';
+
+import { send } from 'loot-core/src/platform/client/fetch';
import { View, Text, Button } from 'loot-design/src/components/common';
import { colors } from 'loot-design/src/style';
-import { send } from 'loot-core/src/platform/client/fetch';
-import { ConfirmPasswordForm } from './ConfirmPasswordForm';
+
import { Title } from './common';
+import { ConfirmPasswordForm } from './ConfirmPasswordForm';
export default function ChangePassword() {
let dispatch = useDispatch();
diff --git a/packages/desktop-client/src/components/manager/subscribe/ConfirmPasswordForm.js b/packages/desktop-client/src/components/manager/subscribe/ConfirmPasswordForm.js
index c71f7a5..52453cd 100644
--- a/packages/desktop-client/src/components/manager/subscribe/ConfirmPasswordForm.js
+++ b/packages/desktop-client/src/components/manager/subscribe/ConfirmPasswordForm.js
@@ -1,5 +1,7 @@
import React, { useState } from 'react';
+
import { View, ButtonWithLoading } from 'loot-design/src/components/common';
+
import { Input } from './common';
export function ConfirmPasswordForm({ buttons, onSetPassword, onError }) {
diff --git a/packages/desktop-client/src/components/manager/subscribe/Error.js b/packages/desktop-client/src/components/manager/subscribe/Error.js
index 8de45a9..82903b1 100644
--- a/packages/desktop-client/src/components/manager/subscribe/Error.js
+++ b/packages/desktop-client/src/components/manager/subscribe/Error.js
@@ -1,5 +1,6 @@
import React from 'react';
import { useHistory, useLocation } from 'react-router-dom';
+
import { View, Text, Button } from 'loot-design/src/components/common';
import { colors } from 'loot-design/src/style';
diff --git a/packages/desktop-client/src/components/manager/subscribe/Login.js b/packages/desktop-client/src/components/manager/subscribe/Login.js
index 76befa8..b0629a9 100644
--- a/packages/desktop-client/src/components/manager/subscribe/Login.js
+++ b/packages/desktop-client/src/components/manager/subscribe/Login.js
@@ -1,6 +1,10 @@
import React, { useState } from 'react';
import { useDispatch } from 'react-redux';
import { useHistory } from 'react-router-dom';
+
+import { createBudget } from 'loot-core/src/client/actions/budgets';
+import { loggedIn } from 'loot-core/src/client/actions/user';
+import { send } from 'loot-core/src/platform/client/fetch';
import {
View,
Text,
@@ -8,9 +12,7 @@ import {
ButtonWithLoading
} from 'loot-design/src/components/common';
import { colors } from 'loot-design/src/style';
-import { loggedIn } from 'loot-core/src/client/actions/user';
-import { createBudget } from 'loot-core/src/client/actions/budgets';
-import { send } from 'loot-core/src/platform/client/fetch';
+
import { useBootstrapped, Title, Input } from './common';
export default function Login() {
diff --git a/packages/desktop-client/src/components/manager/subscribe/common.js b/packages/desktop-client/src/components/manager/subscribe/common.js
index 4c5a25c..9d2ca11 100644
--- a/packages/desktop-client/src/components/manager/subscribe/common.js
+++ b/packages/desktop-client/src/components/manager/subscribe/common.js
@@ -1,12 +1,13 @@
import React, { useEffect, useState } from 'react';
import { useHistory, useLocation } from 'react-router-dom';
+
+import { send } from 'loot-core/src/platform/client/fetch';
import {
Text,
Button,
Input as BaseInput
} from 'loot-design/src/components/common';
import { colors, styles } from 'loot-design/src/style';
-import { send } from 'loot-core/src/platform/client/fetch';
// There are two URLs that dance with each other: `/login` and
// `/bootstrap`. Both of these URLs check the state of the the server
diff --git a/packages/desktop-client/src/components/modals/ConfirmCategoryDelete.js b/packages/desktop-client/src/components/modals/ConfirmCategoryDelete.js
index dd315a8..d737bf1 100644
--- a/packages/desktop-client/src/components/modals/ConfirmCategoryDelete.js
+++ b/packages/desktop-client/src/components/modals/ConfirmCategoryDelete.js
@@ -1,4 +1,6 @@
import React from 'react';
+
+import { NativeCategorySelect } from 'loot-design/src/components/CategorySelect';
import {
View,
Text,
@@ -7,7 +9,6 @@ import {
Button
} from 'loot-design/src/components/common';
import { colors } from 'loot-design/src/style';
-import { NativeCategorySelect } from 'loot-design/src/components/CategorySelect';
class ConfirmCategoryDelete extends React.Component {
state = { transferCategory: null, error: null };
diff --git a/packages/desktop-client/src/components/modals/CreateAccount.js b/packages/desktop-client/src/components/modals/CreateAccount.js
index 1930d2f..c81e295 100644
--- a/packages/desktop-client/src/components/modals/CreateAccount.js
+++ b/packages/desktop-client/src/components/modals/CreateAccount.js
@@ -1,9 +1,12 @@
import React from 'react';
-import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
+
+import { bindActionCreators } from 'redux';
+
import * as actions from 'loot-core/src/client/actions';
import { View, Text, Modal, Button } from 'loot-design/src/components/common';
import { colors } from 'loot-design/src/style';
+
import { authorizeBank } from '../../plaid';
class CreateAccount extends React.Component {
diff --git a/packages/desktop-client/src/components/modals/CreateEncryptionKey.js b/packages/desktop-client/src/components/modals/CreateEncryptionKey.js
index c26de87..c1c0619 100644
--- a/packages/desktop-client/src/components/modals/CreateEncryptionKey.js
+++ b/packages/desktop-client/src/components/modals/CreateEncryptionKey.js
@@ -1,5 +1,9 @@
import React, { useState } from 'react';
+
import { css } from 'glamor';
+
+import { send } from 'loot-core/src/platform/client/fetch';
+import { getCreateKeyError } from 'loot-core/src/shared/errors';
import {
View,
Text,
@@ -11,9 +15,7 @@ import {
Input,
InitialFocus
} from 'loot-design/src/components/common';
-import { send } from 'loot-core/src/platform/client/fetch';
import { colors } from 'loot-design/src/style';
-import { getCreateKeyError } from 'loot-core/src/shared/errors';
export default function CreateEncryptionKey({
modalProps,
diff --git a/packages/desktop-client/src/components/modals/EditRule.js b/packages/desktop-client/src/components/modals/EditRule.js
index c55c2c3..abfdd1e 100644
--- a/packages/desktop-client/src/components/modals/EditRule.js
+++ b/packages/desktop-client/src/components/modals/EditRule.js
@@ -1,24 +1,14 @@
import React, { useState, useEffect, useRef, useCallback } from 'react';
import { useDispatch, useSelector } from 'react-redux';
+
import {
initiallyLoadPayees,
setUndoEnabled
} from 'loot-core/src/client/actions/queries';
+import { useSchedules } from 'loot-core/src/client/data-hooks/schedules';
import q, { runQuery } from 'loot-core/src/client/query-helpers';
-import {
- View,
- Text,
- Modal,
- Button,
- Stack,
- CustomSelect,
- Tooltip
-} from 'loot-design/src/components/common';
import { send } from 'loot-core/src/platform/client/fetch';
-import { colors } from 'loot-design/src/style';
-import SubtractIcon from 'loot-design/src/svg/Subtract';
-import AddIcon from 'loot-design/src/svg/Add';
-import InformationOutline from 'loot-design/src/svg/v1/InformationOutline';
+import * as monthUtils from 'loot-core/src/shared/months';
import {
mapField,
friendlyOp,
@@ -29,21 +19,33 @@ import {
FIELD_TYPES,
TYPE_INFO
} from 'loot-core/src/shared/rules';
-import useSelected, {
- SelectedProvider
-} from 'loot-design/src/components/useSelected';
-import { useSchedules } from 'loot-core/src/client/data-hooks/schedules';
import {
integerToCurrency,
integerToAmount,
amountToInteger
} from 'loot-core/src/shared/util';
-import * as monthUtils from 'loot-core/src/shared/months';
+import {
+ View,
+ Text,
+ Modal,
+ Button,
+ Stack,
+ CustomSelect,
+ Tooltip
+} from 'loot-design/src/components/common';
+import useSelected, {
+ SelectedProvider
+} from 'loot-design/src/components/useSelected';
+import { colors } from 'loot-design/src/style';
+import AddIcon from 'loot-design/src/svg/Add';
+import SubtractIcon from 'loot-design/src/svg/Subtract';
+import InformationOutline from 'loot-design/src/svg/v1/InformationOutline';
+
import SimpleTransactionsTable from '../accounts/SimpleTransactionsTable';
import { StatusBadge } from '../schedules/StatusBadge';
+import { BetweenAmountInput } from '../util/AmountInput';
import DisplayId from '../util/DisplayId';
import GenericInput from '../util/GenericInput';
-import { BetweenAmountInput } from '../util/AmountInput';
function updateValue(array, value, update) {
return array.map(v => (v === value ? update() : v));
diff --git a/packages/desktop-client/src/components/modals/FixEncryptionKey.js b/packages/desktop-client/src/components/modals/FixEncryptionKey.js
index c9c43ca..8f695e7 100644
--- a/packages/desktop-client/src/components/modals/FixEncryptionKey.js
+++ b/packages/desktop-client/src/components/modals/FixEncryptionKey.js
@@ -1,4 +1,7 @@
import React, { useState } from 'react';
+
+import { send } from 'loot-core/src/platform/client/fetch';
+import { getTestKeyError } from 'loot-core/src/shared/errors';
import {
View,
Text,
@@ -11,9 +14,7 @@ import {
InitialFocus,
ExternalLink
} from 'loot-design/src/components/common';
-import { send } from 'loot-core/src/platform/client/fetch';
import { colors } from 'loot-design/src/style';
-import { getTestKeyError } from 'loot-core/src/shared/errors';
export default function FixEncryptionKey({
modalProps,
diff --git a/packages/desktop-client/src/components/modals/ManageRules.js b/packages/desktop-client/src/components/modals/ManageRules.js
index 61f89bb..7a31188 100644
--- a/packages/desktop-client/src/components/modals/ManageRules.js
+++ b/packages/desktop-client/src/components/modals/ManageRules.js
@@ -1,11 +1,23 @@
import React, { useState, useEffect, useRef, useCallback } from 'react';
import { useDispatch, useSelector } from 'react-redux';
-import { css } from 'glamor';
+
import { format as formatDate, parseISO } from 'date-fns';
-import * as undo from 'loot-core/src/platform/client/undo';
+import { css } from 'glamor';
+
+import { pushModal } from 'loot-core/src/client/actions/modals';
import { initiallyLoadPayees } from 'loot-core/src/client/actions/queries';
import q from 'loot-core/src/client/query-helpers';
import { liveQueryContext } from 'loot-core/src/client/query-hooks';
+import { getPayeesById } from 'loot-core/src/client/reducers/queries';
+import { send } from 'loot-core/src/platform/client/fetch';
+import * as undo from 'loot-core/src/platform/client/undo';
+import { getMonthYearFormat } from 'loot-core/src/shared/months';
+import { mapField, friendlyOp } from 'loot-core/src/shared/rules';
+import {
+ extractScheduleConds,
+ getRecurringDescription
+} from 'loot-core/src/shared/schedules';
+import { integerToCurrency } from 'loot-core/src/shared/util';
import {
View,
Text,
@@ -28,18 +40,8 @@ import useSelected, {
useSelectedItems,
SelectedProvider
} from 'loot-design/src/components/useSelected';
-import { integerToCurrency } from 'loot-core/src/shared/util';
-import { send } from 'loot-core/src/platform/client/fetch';
-import { pushModal } from 'loot-core/src/client/actions/modals';
-import { mapField, friendlyOp } from 'loot-core/src/shared/rules';
-import ArrowRight from 'loot-design/src/svg/RightArrow2';
import { colors } from 'loot-design/src/style';
-import { getMonthYearFormat } from 'loot-core/src/shared/months';
-import {
- extractScheduleConds,
- getRecurringDescription
-} from 'loot-core/src/shared/schedules';
-import { getPayeesById } from 'loot-core/src/client/reducers/queries';
+import ArrowRight from 'loot-design/src/svg/RightArrow2';
let SchedulesQuery = liveQueryContext(q('schedules').select('*'));
diff --git a/packages/desktop-client/src/components/modals/MergeUnusedPayees.js b/packages/desktop-client/src/components/modals/MergeUnusedPayees.js
index 58920d0..e76e85c 100644
--- a/packages/desktop-client/src/components/modals/MergeUnusedPayees.js
+++ b/packages/desktop-client/src/components/modals/MergeUnusedPayees.js
@@ -1,5 +1,9 @@
import React, { useState, useRef, useEffect } from 'react';
import { useDispatch, useSelector } from 'react-redux';
+
+import { replaceModal } from 'loot-core/src/client/actions/modals';
+import { send } from 'loot-core/src/platform/client/fetch';
+import { Information } from 'loot-design/src/components/alerts';
import {
View,
Text,
@@ -8,10 +12,7 @@ import {
Button,
P
} from 'loot-design/src/components/common';
-import { Information } from 'loot-design/src/components/alerts';
import { colors } from 'loot-design/src/style';
-import { send } from 'loot-core/src/platform/client/fetch';
-import { replaceModal } from 'loot-core/src/client/actions/modals';
let highlightStyle = { color: colors.p5 };
diff --git a/packages/desktop-client/src/components/modals/WelcomeScreen.js b/packages/desktop-client/src/components/modals/WelcomeScreen.js
index 8cab2fe..b627230 100644
--- a/packages/desktop-client/src/components/modals/WelcomeScreen.js
+++ b/packages/desktop-client/src/components/modals/WelcomeScreen.js
@@ -1,5 +1,6 @@
import React from 'react';
import { connect } from 'react-redux';
+
import * as actions from 'loot-core/src/client/actions';
import {
View,
diff --git a/packages/desktop-client/src/components/payees/ManagePayeesWithData.js b/packages/desktop-client/src/components/payees/ManagePayeesWithData.js
index c80927f..2b7c566 100644
--- a/packages/desktop-client/src/components/payees/ManagePayeesWithData.js
+++ b/packages/desktop-client/src/components/payees/ManagePayeesWithData.js
@@ -1,10 +1,11 @@
import React, { useState, useEffect, useRef } from 'react';
import { connect } from 'react-redux';
+
import * as actions from 'loot-core/src/client/actions';
-import * as undo from 'loot-core/src/platform/client/undo';
import { send, listen } from 'loot-core/src/platform/client/fetch';
-import { ManagePayees } from 'loot-design/src/components/payees';
+import * as undo from 'loot-core/src/platform/client/undo';
import { applyChanges } from 'loot-core/src/shared/util';
+import { ManagePayees } from 'loot-design/src/components/payees';
function ManagePayeesWithData({
history,
diff --git a/packages/desktop-client/src/components/reports/CashFlow.js b/packages/desktop-client/src/components/reports/CashFlow.js
index 45b3ee4..ec99a1a 100644
--- a/packages/desktop-client/src/components/reports/CashFlow.js
+++ b/packages/desktop-client/src/components/reports/CashFlow.js
@@ -1,5 +1,10 @@
import React, { useState, useEffect } from 'react';
+
import * as d from 'date-fns';
+
+import { send } from 'loot-core/src/platform/client/fetch';
+import * as monthUtils from 'loot-core/src/shared/months';
+import { integerToCurrency } from 'loot-core/src/shared/util';
import {
View,
Text,
@@ -7,15 +12,12 @@ import {
P,
AlignedText
} from 'loot-design/src/components/common';
-import { styles } from 'loot-design/src/style';
-import { send } from 'loot-core/src/platform/client/fetch';
-import * as monthUtils from 'loot-core/src/shared/months';
-import { integerToCurrency } from 'loot-core/src/shared/util';
-import { colors } from 'loot-design/src/style';
-import Header from './Header';
+import { colors, styles } from 'loot-design/src/style';
+
import Change from './Change';
-import CashFlowGraph from './graphs/CashFlowGraph';
import { cashFlowByDate } from './graphs/cash-flow-spreadsheet';
+import CashFlowGraph from './graphs/CashFlowGraph';
+import Header from './Header';
import useReport from './useReport';
import { useArgsMemo } from './util';
diff --git a/packages/desktop-client/src/components/reports/Change.js b/packages/desktop-client/src/components/reports/Change.js
index 61e9a37..09af126 100644
--- a/packages/desktop-client/src/components/reports/Change.js
+++ b/packages/desktop-client/src/components/reports/Change.js
@@ -1,8 +1,8 @@
import React from 'react';
-import { styles } from 'loot-design/src/style';
+
import { integerToCurrency } from 'loot-core/src/shared/util';
import { Block } from 'loot-design/src/components/common';
-import { colors } from 'loot-design/src/style';
+import { colors, styles } from 'loot-design/src/style';
function Change({ amount, style }) {
return (
diff --git a/packages/desktop-client/src/components/reports/Container.js b/packages/desktop-client/src/components/reports/Container.js
index 0c53f5d..5542081 100644
--- a/packages/desktop-client/src/components/reports/Container.js
+++ b/packages/desktop-client/src/components/reports/Container.js
@@ -1,7 +1,8 @@
import React from 'react';
-import { View } from 'loot-design/src/components/common';
import AutoSizer from 'react-virtualized-auto-sizer';
+import { View } from 'loot-design/src/components/common';
+
class Container extends React.Component {
render() {
const { style, children } = this.props;
diff --git a/packages/desktop-client/src/components/reports/DateRange.js b/packages/desktop-client/src/components/reports/DateRange.js
index 33719b4..e4c53df 100644
--- a/packages/desktop-client/src/components/reports/DateRange.js
+++ b/packages/desktop-client/src/components/reports/DateRange.js
@@ -1,7 +1,9 @@
import React from 'react';
+
import * as d from 'date-fns';
-import { colors } from 'loot-design/src/style';
+
import { Block } from 'loot-design/src/components/common';
+import { colors } from 'loot-design/src/style';
function DateRange({ start, end }) {
start = d.parseISO(start);
diff --git a/packages/desktop-client/src/components/reports/Header.js b/packages/desktop-client/src/components/reports/Header.js
index a73c9e8..f834401 100644
--- a/packages/desktop-client/src/components/reports/Header.js
+++ b/packages/desktop-client/src/components/reports/Header.js
@@ -1,12 +1,13 @@
import React from 'react';
-import { styles } from 'loot-design/src/style';
+
+import * as monthUtils from 'loot-core/src/shared/months';
import {
View,
Select,
Button,
ButtonLink
} from 'loot-design/src/components/common';
-import * as monthUtils from 'loot-core/src/shared/months';
+import { styles } from 'loot-design/src/style';
import ArrowLeft from 'loot-design/src/svg/v1/ArrowLeft';
function validateStart(allMonths, start, end) {
diff --git a/packages/desktop-client/src/components/reports/NetWorth.js b/packages/desktop-client/src/components/reports/NetWorth.js
index 40e007d..9a17a1e 100644
--- a/packages/desktop-client/src/components/reports/NetWorth.js
+++ b/packages/desktop-client/src/components/reports/NetWorth.js
@@ -1,20 +1,22 @@
import React, { useState, useEffect } from 'react';
-import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
+
import * as d from 'date-fns';
+import { bindActionCreators } from 'redux';
+
import * as actions from 'loot-core/src/client/actions';
-import { View, P } from 'loot-design/src/components/common';
-import { styles } from 'loot-design/src/style';
+import { send } from 'loot-core/src/platform/client/fetch';
import * as monthUtils from 'loot-core/src/shared/months';
import { integerToCurrency } from 'loot-core/src/shared/util';
-import { send } from 'loot-core/src/platform/client/fetch';
-import Header from './Header';
-import { fromDateRepr } from './util';
-import useReport from './useReport';
+import { View, P } from 'loot-design/src/components/common';
+import { styles } from 'loot-design/src/style';
+
+import Change from './Change';
import netWorthSpreadsheet from './graphs/net-worth-spreadsheet';
import NetWorthGraph from './graphs/NetWorthGraph';
-import Change from './Change';
-import { useArgsMemo } from './util';
+import Header from './Header';
+import useReport from './useReport';
+import { fromDateRepr, useArgsMemo } from './util';
function NetWorth({ accounts }) {
const [earliestMonth, setEarliestMonth] = useState(null);
diff --git a/packages/desktop-client/src/components/reports/Overview.js b/packages/desktop-client/src/components/reports/Overview.js
index 2366656..8005e6c 100644
--- a/packages/desktop-client/src/components/reports/Overview.js
+++ b/packages/desktop-client/src/components/reports/Overview.js
@@ -1,22 +1,25 @@
import React from 'react';
-import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
+
+import { bindActionCreators } from 'redux';
import { VictoryBar, VictoryGroup, VictoryVoronoiContainer } from 'victory';
+
import * as actions from 'loot-core/src/client/actions';
-import { View, Block, AnchorLink } from 'loot-design/src/components/common';
-import { colors, styles } from 'loot-design/src/style';
import * as monthUtils from 'loot-core/src/shared/months';
import { integerToCurrency } from 'loot-core/src/shared/util';
-import { useArgsMemo } from './util';
+import { View, Block, AnchorLink } from 'loot-design/src/components/common';
+import { colors, styles } from 'loot-design/src/style';
+
+import Change from './Change';
import theme from './chart-theme';
import Container from './Container';
+import DateRange from './DateRange';
+import { simpleCashFlow } from './graphs/cash-flow-spreadsheet';
+import netWorthSpreadsheet from './graphs/net-worth-spreadsheet';
+import NetWorthGraph from './graphs/NetWorthGraph';
import Tooltip from './Tooltip';
import useReport from './useReport';
-import netWorthSpreadsheet from './graphs/net-worth-spreadsheet';
-import { simpleCashFlow } from './graphs/cash-flow-spreadsheet';
-import NetWorthGraph from './graphs/NetWorthGraph';
-import Change from './Change';
-import DateRange from './DateRange';
+import { useArgsMemo } from './util';
function Card({ flex, to, style, children }) {
const containerProps = { flex, margin: 15 };
diff --git a/packages/desktop-client/src/components/reports/Tooltip.js b/packages/desktop-client/src/components/reports/Tooltip.js
index b2a1654..81eb277 100644
--- a/packages/desktop-client/src/components/reports/Tooltip.js
+++ b/packages/desktop-client/src/components/reports/Tooltip.js
@@ -1,7 +1,9 @@
import React from 'react';
import ReactDOM from 'react-dom';
-import { VictoryTooltip } from 'victory';
+
import { css, before } from 'glamor';
+import { VictoryTooltip } from 'victory';
+
import { colors } from 'loot-design/src/style';
class Tooltip extends React.Component {
diff --git a/packages/desktop-client/src/components/reports/graphs/CashFlowGraph.js b/packages/desktop-client/src/components/reports/graphs/CashFlowGraph.js
index ea050ab..17da3c8 100644
--- a/packages/desktop-client/src/components/reports/graphs/CashFlowGraph.js
+++ b/packages/desktop-client/src/components/reports/graphs/CashFlowGraph.js
@@ -1,4 +1,6 @@
import React from 'react';
+
+import * as d from 'date-fns';
import {
VictoryChart,
VictoryBar,
@@ -7,11 +9,12 @@ import {
VictoryVoronoiContainer,
VictoryGroup
} from 'victory';
-import * as d from 'date-fns';
+
import { colors } from 'loot-design/src/style';
+
+import theme from '../chart-theme';
import Container from '../Container';
import Tooltip from '../Tooltip';
-import theme from '../chart-theme';
function CashFlowGraph({ style, start, end, graphData, isConcise, compact }) {
return (
diff --git a/packages/desktop-client/src/components/reports/graphs/NetWorthGraph.js b/packages/desktop-client/src/components/reports/graphs/NetWorthGraph.js
index 0a894fd..93a8c17 100644
--- a/packages/desktop-client/src/components/reports/graphs/NetWorthGraph.js
+++ b/packages/desktop-client/src/components/reports/graphs/NetWorthGraph.js
@@ -1,4 +1,6 @@
import React from 'react';
+
+import * as d from 'date-fns';
import {
VictoryChart,
VictoryBar,
@@ -7,10 +9,10 @@ import {
VictoryVoronoiContainer,
VictoryGroup
} from 'victory';
-import * as d from 'date-fns';
+
+import theme from '../chart-theme';
import Container from '../Container';
import Tooltip from '../Tooltip';
-import theme from '../chart-theme';
function Area({ start, end, data, style, scale, range }) {
const zero = scale.y(0);
diff --git a/packages/desktop-client/src/components/reports/graphs/cash-flow-spreadsheet.js b/packages/desktop-client/src/components/reports/graphs/cash-flow-spreadsheet.js
index e7400fa..c555067 100644
--- a/packages/desktop-client/src/components/reports/graphs/cash-flow-spreadsheet.js
+++ b/packages/desktop-client/src/components/reports/graphs/cash-flow-spreadsheet.js
@@ -1,9 +1,12 @@
import React from 'react';
-import * as monthUtils from 'loot-core/src/shared/months';
+
import * as d from 'date-fns';
-import { AlignedText } from 'loot-design/src/components/common';
-import { integerToCurrency, integerToAmount } from 'loot-core/src/shared/util';
+
import q from 'loot-core/src/client/query-helpers';
+import * as monthUtils from 'loot-core/src/shared/months';
+import { integerToCurrency, integerToAmount } from 'loot-core/src/shared/util';
+import { AlignedText } from 'loot-design/src/components/common';
+
import { fromDateRepr, fromDateReprToDay, runAll, index } from '../util';
export function simpleCashFlow(start, end) {
diff --git a/packages/desktop-client/src/components/reports/graphs/net-worth-spreadsheet.js b/packages/desktop-client/src/components/reports/graphs/net-worth-spreadsheet.js
index 7c09f2b..b3de61c 100644
--- a/packages/desktop-client/src/components/reports/graphs/net-worth-spreadsheet.js
+++ b/packages/desktop-client/src/components/reports/graphs/net-worth-spreadsheet.js
@@ -1,13 +1,16 @@
import React from 'react';
-import * as monthUtils from 'loot-core/src/shared/months';
+
import * as d from 'date-fns';
-import { AlignedText } from 'loot-design/src/components/common';
+
import q, { runQuery } from 'loot-core/src/client/query-helpers';
+import * as monthUtils from 'loot-core/src/shared/months';
import {
integerToCurrency,
integerToAmount,
amountToInteger
} from 'loot-core/src/shared/util';
+import { AlignedText } from 'loot-design/src/components/common';
+
import { index } from '../util';
export default function createSpreadsheet(start, end, accounts) {
diff --git a/packages/desktop-client/src/components/reports/index.js b/packages/desktop-client/src/components/reports/index.js
index b4ff198..2c50538 100644
--- a/packages/desktop-client/src/components/reports/index.js
+++ b/packages/desktop-client/src/components/reports/index.js
@@ -1,9 +1,11 @@
import React from 'react';
import { Route } from 'react-router-dom';
+
import { View } from 'loot-design/src/components/common';
-import Overview from './Overview';
-import NetWorth from './NetWorth';
+
import CashFlow from './CashFlow';
+import NetWorth from './NetWorth';
+import Overview from './Overview';
class Reports extends React.Component {
render() {
diff --git a/packages/desktop-client/src/components/reports/util.js b/packages/desktop-client/src/components/reports/util.js
index 5c297ca..078d54d 100644
--- a/packages/desktop-client/src/components/reports/util.js
+++ b/packages/desktop-client/src/components/reports/util.js
@@ -1,4 +1,5 @@
import { useMemo } from 'react';
+
import { runQuery } from 'loot-core/src/client/query-helpers';
export function useArgsMemo(func) {
diff --git a/packages/desktop-client/src/components/schedules/DiscoverSchedules.js b/packages/desktop-client/src/components/schedules/DiscoverSchedules.js
index ae2602c..f9fff59 100644
--- a/packages/desktop-client/src/components/schedules/DiscoverSchedules.js
+++ b/packages/desktop-client/src/components/schedules/DiscoverSchedules.js
@@ -1,8 +1,10 @@
import React, { useState, useEffect } from 'react';
import { useLocation, useHistory } from 'react-router-dom';
-import q, { runQuery } from 'loot-core/src/client/query-helpers';
+
import Platform from 'loot-core/src/client/platform';
+import q, { runQuery } from 'loot-core/src/client/query-helpers';
import { send } from 'loot-core/src/platform/client/fetch';
+import { getRecurringDescription } from 'loot-core/src/shared/schedules';
import {
View,
Stack,
@@ -17,13 +19,13 @@ import {
Field,
SelectCell
} from 'loot-design/src/components/table';
-import { getRecurringDescription } from 'loot-core/src/shared/schedules';
-import { colors } from 'loot-design/src/style';
import useSelected, {
useSelectedDispatch,
useSelectedItems,
SelectedProvider
} from 'loot-design/src/components/useSelected';
+import { colors } from 'loot-design/src/style';
+
import { Page } from '../Page';
import DisplayId from '../util/DisplayId';
import { ScheduleAmountCell } from './SchedulesTable';
diff --git a/packages/desktop-client/src/components/schedules/EditSchedule.js b/packages/desktop-client/src/components/schedules/EditSchedule.js
index 1bc88f6..7d2ec3f 100644
--- a/packages/desktop-client/src/components/schedules/EditSchedule.js
+++ b/packages/desktop-client/src/components/schedules/EditSchedule.js
@@ -1,31 +1,32 @@
import React, { useEffect, useReducer } from 'react';
-import { useParams, useHistory } from 'react-router-dom';
import { useDispatch, useSelector } from 'react-redux';
+import { useParams, useHistory } from 'react-router-dom';
+
import { pushModal } from 'loot-core/src/client/actions/modals';
-import { send, sendCatch } from 'loot-core/src/platform/client/fetch';
-import q, { runQuery, liveQuery } from 'loot-core/src/client/query-helpers';
-import { extractScheduleConds } from 'loot-core/src/shared/schedules';
-import * as monthUtils from 'loot-core/src/shared/months';
import { useCachedPayees } from 'loot-core/src/client/data-hooks/payees';
+import q, { runQuery, liveQuery } from 'loot-core/src/client/query-helpers';
+import { send, sendCatch } from 'loot-core/src/platform/client/fetch';
+import * as monthUtils from 'loot-core/src/shared/months';
+import { extractScheduleConds } from 'loot-core/src/shared/schedules';
+import AccountAutocomplete from 'loot-design/src/components/AccountAutocomplete';
+import { Stack, View, Text, Button } from 'loot-design/src/components/common';
+import DateSelect from 'loot-design/src/components/DateSelect';
import {
FormField,
FormLabel,
Checkbox
} from 'loot-design/src/components/forms';
-import { colors } from 'loot-design/src/style';
import PayeeAutocomplete from 'loot-design/src/components/PayeeAutocomplete';
-import AccountAutocomplete from 'loot-design/src/components/AccountAutocomplete';
-import { Stack, View, Text, Button } from 'loot-design/src/components/common';
-import DateSelect from 'loot-design/src/components/DateSelect';
+import RecurringSchedulePicker from 'loot-design/src/components/RecurringSchedulePicker';
import { SelectedItemsButton } from 'loot-design/src/components/table';
import useSelected, {
SelectedProvider
} from 'loot-design/src/components/useSelected';
-import RecurringSchedulePicker from 'loot-design/src/components/RecurringSchedulePicker';
+import { colors } from 'loot-design/src/style';
+
import SimpleTransactionsTable from '../accounts/SimpleTransactionsTable';
-import { usePageType } from '../Page';
-import { Page } from '../Page';
import { OpSelect } from '../modals/EditRule';
+import { Page, usePageType } from '../Page';
import { AmountInput, BetweenAmountInput } from '../util/AmountInput';
import { useTranslation } from 'react-i18next';
diff --git a/packages/desktop-client/src/components/schedules/LinkSchedule.js b/packages/desktop-client/src/components/schedules/LinkSchedule.js
index 1daa056..07d1b46 100644
--- a/packages/desktop-client/src/components/schedules/LinkSchedule.js
+++ b/packages/desktop-client/src/components/schedules/LinkSchedule.js
@@ -1,9 +1,11 @@
import React, { useCallback } from 'react';
import { useSelector } from 'react-redux';
import { useLocation, useHistory } from 'react-router-dom';
+
import { useSchedules } from 'loot-core/src/client/data-hooks/schedules';
import { send } from 'loot-core/src/platform/client/fetch';
import { Text } from 'loot-design/src/components/common';
+
import { Page } from '../Page';
import { SchedulesTable } from './SchedulesTable';
diff --git a/packages/desktop-client/src/components/schedules/PostsOfflineNotification.js b/packages/desktop-client/src/components/schedules/PostsOfflineNotification.js
index 2d7cdcd..722379c 100644
--- a/packages/desktop-client/src/components/schedules/PostsOfflineNotification.js
+++ b/packages/desktop-client/src/components/schedules/PostsOfflineNotification.js
@@ -1,8 +1,10 @@
import React from 'react';
import { useLocation, useHistory } from 'react-router-dom';
+
import { send } from 'loot-core/src/platform/client/fetch';
import { Text, P, Button, Stack } from 'loot-design/src/components/common';
import { colors } from 'loot-design/src/style';
+
import { Page } from '../Page';
import DisplayId from '../util/DisplayId';
diff --git a/packages/desktop-client/src/components/schedules/SchedulesTable.js b/packages/desktop-client/src/components/schedules/SchedulesTable.js
index 141faf7..2935bbf 100644
--- a/packages/desktop-client/src/components/schedules/SchedulesTable.js
+++ b/packages/desktop-client/src/components/schedules/SchedulesTable.js
@@ -1,7 +1,9 @@
import React, { useState, useMemo } from 'react';
import { useSelector } from 'react-redux';
+
+import * as monthUtils from 'loot-core/src/shared/months';
+import { getScheduledAmount } from 'loot-core/src/shared/schedules';
import { integerToCurrency } from 'loot-core/src/shared/util';
-import { colors } from 'loot-design/src/style';
import {
View,
Text,
@@ -16,10 +18,10 @@ import {
Field,
Cell
} from 'loot-design/src/components/table';
-import * as monthUtils from 'loot-core/src/shared/months';
-import { getScheduledAmount } from 'loot-core/src/shared/schedules';
+import { colors } from 'loot-design/src/style';
import DotsHorizontalTriple from 'loot-design/src/svg/v1/DotsHorizontalTriple';
import Check from 'loot-design/src/svg/v2/Check';
+
import DisplayId from '../util/DisplayId';
import { StatusBadge } from './StatusBadge';
import { useTranslation } from 'react-i18next';
diff --git a/packages/desktop-client/src/components/schedules/StatusBadge.js b/packages/desktop-client/src/components/schedules/StatusBadge.js
index 244cc97..52823b3 100644
--- a/packages/desktop-client/src/components/schedules/StatusBadge.js
+++ b/packages/desktop-client/src/components/schedules/StatusBadge.js
@@ -1,15 +1,15 @@
import React from 'react';
-import { colors } from 'loot-design/src/style';
-import { View, Text } from 'loot-design/src/components/common';
-import { titleFirst } from 'loot-core/src/shared/util';
+import { useTranslation } from 'react-i18next';
-import EditSkull1 from 'loot-design/src/svg/v2/EditSkull1';
+import { titleFirst } from 'loot-core/src/shared/util';
+import { View, Text } from 'loot-design/src/components/common';
+import { colors } from 'loot-design/src/style';
import AlertTriangle from 'loot-design/src/svg/v2/AlertTriangle';
import CalendarIcon from 'loot-design/src/svg/v2/Calendar';
-import ValidationCheck from 'loot-design/src/svg/v2/ValidationCheck';
-import FavoriteStar from 'loot-design/src/svg/v2/FavoriteStar';
import CheckCircle1 from 'loot-design/src/svg/v2/CheckCircle1';
-import { useTranslation } from 'react-i18next';
+import EditSkull1 from 'loot-design/src/svg/v2/EditSkull1';
+import FavoriteStar from 'loot-design/src/svg/v2/FavoriteStar';
+import ValidationCheck from 'loot-design/src/svg/v2/ValidationCheck';
export function getStatusProps(status) {
let color, backgroundColor, Icon, title;
diff --git a/packages/desktop-client/src/components/schedules/index.js b/packages/desktop-client/src/components/schedules/index.js
index abd0561..8564519 100644
--- a/packages/desktop-client/src/components/schedules/index.js
+++ b/packages/desktop-client/src/components/schedules/index.js
@@ -1,8 +1,10 @@
import React from 'react';
import { useHistory } from 'react-router-dom';
-import { View, Button } from 'loot-design/src/components/common';
-import { send } from 'loot-core/src/platform/client/fetch';
+
import { useSchedules } from 'loot-core/src/client/data-hooks/schedules';
+import { send } from 'loot-core/src/platform/client/fetch';
+import { View, Button } from 'loot-design/src/components/common';
+
import { Page } from '../Page';
import { SchedulesTable, ROW_HEIGHT } from './SchedulesTable';
import { useTranslation } from 'react-i18next';
diff --git a/packages/desktop-client/src/components/tools/FixSplitsTool.js b/packages/desktop-client/src/components/tools/FixSplitsTool.js
index 15e5026..0b8a36e 100644
--- a/packages/desktop-client/src/components/tools/FixSplitsTool.js
+++ b/packages/desktop-client/src/components/tools/FixSplitsTool.js
@@ -1,7 +1,9 @@
import React, { useState } from 'react';
+
import { send } from 'loot-core/src/platform/client/fetch';
-import { colors } from 'loot-design/src/style';
import { View, P, ButtonWithLoading } from 'loot-design/src/components/common';
+import { colors } from 'loot-design/src/style';
+
import { Page } from '../Page';
function renderResults(results) {
diff --git a/packages/desktop-client/src/components/tutorial/BudgetCategories.js b/packages/desktop-client/src/components/tutorial/BudgetCategories.js
index 3efb8de..bf7beb1 100644
--- a/packages/desktop-client/src/components/tutorial/BudgetCategories.js
+++ b/packages/desktop-client/src/components/tutorial/BudgetCategories.js
@@ -1,8 +1,10 @@
import React from 'react';
+
import { Tooltip, Pointer, P } from 'loot-design/src/components/common';
import { colors } from 'loot-design/src/style';
-import Navigation from './Navigation';
+
import { Title } from './common';
+import Navigation from './Navigation';
function BudgetInitial({ targetRect, navigationProps }) {
return (
diff --git a/packages/desktop-client/src/components/tutorial/BudgetInitial.js b/packages/desktop-client/src/components/tutorial/BudgetInitial.js
index 55d5bf2..ba10504 100644
--- a/packages/desktop-client/src/components/tutorial/BudgetInitial.js
+++ b/packages/desktop-client/src/components/tutorial/BudgetInitial.js
@@ -1,8 +1,11 @@
import React from 'react';
-import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
+
+import { bindActionCreators } from 'redux';
+
import * as actions from 'loot-core/src/client/actions';
import { P, Button } from 'loot-design/src/components/common';
+
import { Title, Standalone, useMinimized } from './common';
import Navigation from './Navigation';
diff --git a/packages/desktop-client/src/components/tutorial/BudgetNewIncome.js b/packages/desktop-client/src/components/tutorial/BudgetNewIncome.js
index ff1bf88..70d9218 100644
--- a/packages/desktop-client/src/components/tutorial/BudgetNewIncome.js
+++ b/packages/desktop-client/src/components/tutorial/BudgetNewIncome.js
@@ -1,8 +1,10 @@
import React from 'react';
+
import { Tooltip, Pointer, P } from 'loot-design/src/components/common';
import { colors } from 'loot-design/src/style';
-import Navigation from './Navigation';
+
import { Title } from './common';
+import Navigation from './Navigation';
function BudgetSummary({ targetRect, navigationProps }) {
return (
diff --git a/packages/desktop-client/src/components/tutorial/BudgetNextMonth.js b/packages/desktop-client/src/components/tutorial/BudgetNextMonth.js
index 7e36c49..24a2e3d 100644
--- a/packages/desktop-client/src/components/tutorial/BudgetNextMonth.js
+++ b/packages/desktop-client/src/components/tutorial/BudgetNextMonth.js
@@ -1,10 +1,13 @@
import React from 'react';
-import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
+
+import { bindActionCreators } from 'redux';
+
import * as actions from 'loot-core/src/client/actions';
import { View, P, Button } from 'loot-design/src/components/common';
-import Navigation from './Navigation';
+
import { Standalone, Title, useMinimized } from './common';
+import Navigation from './Navigation';
function BudgetNextMonth({ stepTwo, navigationProps }) {
let [minimized, toggle] = useMinimized();
diff --git a/packages/desktop-client/src/components/tutorial/BudgetSummary.js b/packages/desktop-client/src/components/tutorial/BudgetSummary.js
index 0a3e4ab..e20bc28 100644
--- a/packages/desktop-client/src/components/tutorial/BudgetSummary.js
+++ b/packages/desktop-client/src/components/tutorial/BudgetSummary.js
@@ -1,8 +1,10 @@
import React from 'react';
+
import { Tooltip, Pointer, P } from 'loot-design/src/components/common';
import { colors } from 'loot-design/src/style';
-import Navigation from './Navigation';
+
import { Title } from './common';
+import Navigation from './Navigation';
function BudgetSummary({ fromYNAB, targetRect, navigationProps }) {
return (
diff --git a/packages/desktop-client/src/components/tutorial/CategoryBalance.js b/packages/desktop-client/src/components/tutorial/CategoryBalance.js
index ff99329..fcee158 100644
--- a/packages/desktop-client/src/components/tutorial/CategoryBalance.js
+++ b/packages/desktop-client/src/components/tutorial/CategoryBalance.js
@@ -1,7 +1,9 @@
import React from 'react';
+
import { P, Button } from 'loot-design/src/components/common';
-import Navigation from './Navigation';
+
import { Standalone, Title, useMinimized } from './common';
+import Navigation from './Navigation';
function CategoryBalance({ targetRect, navigationProps }) {
let [minimized, toggle] = useMinimized();
diff --git a/packages/desktop-client/src/components/tutorial/DeleteTransactions.js b/packages/desktop-client/src/components/tutorial/DeleteTransactions.js
index b432a71..2d9b7b7 100644
--- a/packages/desktop-client/src/components/tutorial/DeleteTransactions.js
+++ b/packages/desktop-client/src/components/tutorial/DeleteTransactions.js
@@ -1,7 +1,9 @@
import React from 'react';
+
import { P } from 'loot-design/src/components/common';
-import Navigation from './Navigation';
+
import { Standalone, Title } from './common';
+import Navigation from './Navigation';
function DeleteTransactions({ targetRect, navigationProps }) {
return (
diff --git a/packages/desktop-client/src/components/tutorial/Final.js b/packages/desktop-client/src/components/tutorial/Final.js
index 91d8a70..7b11fb0 100644
--- a/packages/desktop-client/src/components/tutorial/Final.js
+++ b/packages/desktop-client/src/components/tutorial/Final.js
@@ -1,5 +1,7 @@
import React from 'react';
+
import { P, ModalButtons, Button } from 'loot-design/src/components/common';
+
import { Standalone, Title, ExternalLink } from './common';
function Final({ targetRect, navigationProps }) {
diff --git a/packages/desktop-client/src/components/tutorial/Intro.js b/packages/desktop-client/src/components/tutorial/Intro.js
index 2bab2fb..2bb9396 100644
--- a/packages/desktop-client/src/components/tutorial/Intro.js
+++ b/packages/desktop-client/src/components/tutorial/Intro.js
@@ -1,4 +1,5 @@
import React from 'react';
+
import {
View,
Text,
@@ -6,6 +7,7 @@ import {
ModalButtons,
Button
} from 'loot-design/src/components/common';
+
import { Standalone, Title, ExternalLink } from './common';
function Intro({ fromYNAB, nextTutorialStage, closeTutorial }) {
diff --git a/packages/desktop-client/src/components/tutorial/Navigation.js b/packages/desktop-client/src/components/tutorial/Navigation.js
index 5301db3..2ab184c 100644
--- a/packages/desktop-client/src/components/tutorial/Navigation.js
+++ b/packages/desktop-client/src/components/tutorial/Navigation.js
@@ -1,4 +1,5 @@
import React from 'react';
+
import { Button, ModalButtons } from 'loot-design/src/components/common';
function Navigation({
diff --git a/packages/desktop-client/src/components/tutorial/Overspending.js b/packages/desktop-client/src/components/tutorial/Overspending.js
index 26b9a3c..fd4881c 100644
--- a/packages/desktop-client/src/components/tutorial/Overspending.js
+++ b/packages/desktop-client/src/components/tutorial/Overspending.js
@@ -1,14 +1,17 @@
import React from 'react';
-import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
+
+import { bindActionCreators } from 'redux';
+
import * as actions from 'loot-core/src/client/actions';
-import SheetValue from 'loot-design/src/components/spreadsheet/SheetValue';
-import NamespaceContext from 'loot-design/src/components/spreadsheet/NamespaceContext';
-import { P, View, Text, Button } from 'loot-design/src/components/common';
import * as monthUtils from 'loot-core/src/shared/months';
import { integerToCurrency } from 'loot-core/src/shared/util';
-import Navigation from './Navigation';
+import { P, View, Text, Button } from 'loot-design/src/components/common';
+import NamespaceContext from 'loot-design/src/components/spreadsheet/NamespaceContext';
+import SheetValue from 'loot-design/src/components/spreadsheet/SheetValue';
+
import { Standalone, Title, useMinimized } from './common';
+import Navigation from './Navigation';
function Overspending({ navigationProps, stepTwo }) {
let currentMonth = monthUtils.currentMonth();
diff --git a/packages/desktop-client/src/components/tutorial/TransactionAdd.js b/packages/desktop-client/src/components/tutorial/TransactionAdd.js
index 5f2e9b0..6ae808e 100644
--- a/packages/desktop-client/src/components/tutorial/TransactionAdd.js
+++ b/packages/desktop-client/src/components/tutorial/TransactionAdd.js
@@ -1,8 +1,10 @@
import React from 'react';
+
import { Tooltip, Pointer, P } from 'loot-design/src/components/common';
import { colors } from 'loot-design/src/style';
-import Navigation from './Navigation';
+
import { Title } from './common';
+import Navigation from './Navigation';
function TransactionAdd({ targetRect, navigationProps }) {
return (
diff --git a/packages/desktop-client/src/components/tutorial/TransactionEnter.js b/packages/desktop-client/src/components/tutorial/TransactionEnter.js
index f06ecc1..00db523 100644
--- a/packages/desktop-client/src/components/tutorial/TransactionEnter.js
+++ b/packages/desktop-client/src/components/tutorial/TransactionEnter.js
@@ -1,8 +1,10 @@
import React from 'react';
-import { P } from 'loot-design/src/components/common';
+
import * as monthUtils from 'loot-core/src/shared/months';
-import Navigation from './Navigation';
+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();
diff --git a/packages/desktop-client/src/components/tutorial/TransactionFinalize.js b/packages/desktop-client/src/components/tutorial/TransactionFinalize.js
index 266e583..847aa82 100644
--- a/packages/desktop-client/src/components/tutorial/TransactionFinalize.js
+++ b/packages/desktop-client/src/components/tutorial/TransactionFinalize.js
@@ -1,8 +1,11 @@
import React from 'react';
-import { P } from 'loot-design/src/components/common';
+
import { css } from 'glamor';
-import Navigation from './Navigation';
+
+import { P } from 'loot-design/src/components/common';
+
import { Standalone } from './common';
+import Navigation from './Navigation';
function TransactionFinalize({ navigationProps }) {
return (
diff --git a/packages/desktop-client/src/components/tutorial/common.js b/packages/desktop-client/src/components/tutorial/common.js
index 8ec1f69..39d64bb 100644
--- a/packages/desktop-client/src/components/tutorial/common.js
+++ b/packages/desktop-client/src/components/tutorial/common.js
@@ -1,6 +1,8 @@
import React, { useState } from 'react';
+
import { View, AnchorLink } from 'loot-design/src/components/common';
import { colors } from 'loot-design/src/style';
+
import AnimateIn from './AnimateIn';
export function Title({ children }) {
diff --git a/packages/desktop-client/src/components/util/AmountInput.js b/packages/desktop-client/src/components/util/AmountInput.js
index 1e4184c..bdf657e 100644
--- a/packages/desktop-client/src/components/util/AmountInput.js
+++ b/packages/desktop-client/src/components/util/AmountInput.js
@@ -1,4 +1,5 @@
import React, { useState } from 'react';
+
import {
integerToCurrency,
currencyToInteger
diff --git a/packages/desktop-client/src/components/util/DisplayId.js b/packages/desktop-client/src/components/util/DisplayId.js
index c69df07..3275096 100644
--- a/packages/desktop-client/src/components/util/DisplayId.js
+++ b/packages/desktop-client/src/components/util/DisplayId.js
@@ -1,6 +1,7 @@
import React from 'react';
-import { CachedPayees } from 'loot-core/src/client/data-hooks/payees';
+
import { CachedAccounts } from 'loot-core/src/client/data-hooks/accounts';
+import { CachedPayees } from 'loot-core/src/client/data-hooks/payees';
import { Text } from 'loot-design/src/components/common';
import { colors } from 'loot-design/src/style';
diff --git a/packages/desktop-client/src/components/util/GenericInput.js b/packages/desktop-client/src/components/util/GenericInput.js
index ffefd22..8d8c6ae 100644
--- a/packages/desktop-client/src/components/util/GenericInput.js
+++ b/packages/desktop-client/src/components/util/GenericInput.js
@@ -1,12 +1,13 @@
import React from 'react';
import { useSelector } from 'react-redux';
+
import { getMonthYearFormat } from 'loot-core/src/shared/months';
-import { View, Input } from 'loot-design/src/components/common';
-import PayeeAutocomplete from 'loot-design/src/components/PayeeAutocomplete';
import AccountAutocomplete from 'loot-design/src/components/AccountAutocomplete';
import Autocomplete from 'loot-design/src/components/Autocomplete';
import CategoryAutocomplete from 'loot-design/src/components/CategorySelect';
+import { View, Input } from 'loot-design/src/components/common';
import DateSelect from 'loot-design/src/components/DateSelect';
+import PayeeAutocomplete from 'loot-design/src/components/PayeeAutocomplete';
import RecurringSchedulePicker from 'loot-design/src/components/RecurringSchedulePicker';
export default function GenericInput({
diff --git a/packages/desktop-client/src/global-events.js b/packages/desktop-client/src/global-events.js
index 95b8392..d465c39 100644
--- a/packages/desktop-client/src/global-events.js
+++ b/packages/desktop-client/src/global-events.js
@@ -1,6 +1,6 @@
+import * as sharedListeners from 'loot-core/src/client/shared-listeners';
import { send, listen } from 'loot-core/src/platform/client/fetch';
import * as undo from 'loot-core/src/platform/client/undo';
-import * as sharedListeners from 'loot-core/src/client/shared-listeners';
export function handleGlobalEvents(actions, store) {
global.Actual.onEventFromMain('update-downloaded', (event, info) => {
diff --git a/packages/desktop-client/src/hooks/useServerVersion.js b/packages/desktop-client/src/hooks/useServerVersion.js
index 3b3f272..07fd31d 100644
--- a/packages/desktop-client/src/hooks/useServerVersion.js
+++ b/packages/desktop-client/src/hooks/useServerVersion.js
@@ -1,4 +1,5 @@
import { useState, useEffect } from 'react';
+
import { send } from 'loot-core/src/platform/client/fetch';
function useServerVersion() {
diff --git a/packages/desktop-client/src/index.js b/packages/desktop-client/src/index.js
index f768df9..ce43bb2 100644
--- a/packages/desktop-client/src/index.js
+++ b/packages/desktop-client/src/index.js
@@ -5,25 +5,28 @@ import './browser-preload';
// A hack for now: this makes sure it's appended before glamor
import '@reach/listbox/styles.css';
+import './locales';
import React from 'react';
import ReactDOM from 'react-dom';
+import { Provider } from 'react-redux';
+
import {
createStore,
combineReducers,
applyMiddleware,
bindActionCreators
} from 'redux';
-import { Provider } from 'react-redux';
-import constants from 'loot-core/src/client/constants';
-import reducers from 'loot-core/src/client/reducers';
-import { send } from 'loot-core/src/platform/client/fetch';
-import q, { runQuery } from 'loot-core/src/client/query-helpers';
-import * as actions from 'loot-core/src/client/actions';
import thunk from 'redux-thunk';
+
+import * as actions from 'loot-core/src/client/actions';
+import constants from 'loot-core/src/client/constants';
+import q, { runQuery } from 'loot-core/src/client/query-helpers';
+import reducers from 'loot-core/src/client/reducers';
import { initialState as initialAppState } from 'loot-core/src/client/reducers/app';
-import { handleGlobalEvents } from './global-events';
-import './locales';
+import { send } from 'loot-core/src/platform/client/fetch';
+
import App from './components/App';
+import { handleGlobalEvents } from './global-events';
// See https://github.com/WICG/focus-visible. Only makes the blue
// focus outline appear from keyboard events.
diff --git a/packages/desktop-electron/package.json b/packages/desktop-electron/package.json
index 7e70c86..29df4a2 100644
--- a/packages/desktop-electron/package.json
+++ b/packages/desktop-electron/package.json
@@ -48,7 +48,7 @@
"electron-is-dev": "2.0.0",
"electron-log": "4.3.2",
"electron-updater": "4.3.8",
- "loot-core": "workspace:*",
+ "loot-core": "*",
"node-fetch": "^1.6.3",
"node-ipc": "9.1.4"
},
diff --git a/packages/import-ynab4/package.json b/packages/import-ynab4/package.json
index e559193..138abc3 100644
--- a/packages/import-ynab4/package.json
+++ b/packages/import-ynab4/package.json
@@ -16,7 +16,7 @@
"bin": "./index.js",
"homepage": "https://github.com/actualbudget/actual/tree/master/packages/import-ynab4#readme",
"dependencies": {
- "@actual-app/api": "workspace:*",
+ "@actual-app/api": "^1.0.0",
"adm-zip": "^0.5.9",
"date-fns": "2.0.0-alpha.27",
"slash": "3.0.0",
diff --git a/packages/import-ynab5/package.json b/packages/import-ynab5/package.json
index 1c04a71..a15fe5f 100644
--- a/packages/import-ynab5/package.json
+++ b/packages/import-ynab5/package.json
@@ -16,7 +16,7 @@
"bin": "./index.js",
"homepage": "https://github.com/actualbudget/actual/tree/master/packages/import-ynab5#readme",
"dependencies": {
- "@actual-app/api": "workspace:*",
+ "@actual-app/api": "^1.0.0",
"date-fns": "2.0.0-alpha.27",
"uuid": "3.3.2"
}
diff --git a/packages/loot-core/bin/profile-sql.js b/packages/loot-core/bin/profile-sql.js
index 4842025..a56f3f1 100755
--- a/packages/loot-core/bin/profile-sql.js
+++ b/packages/loot-core/bin/profile-sql.js
@@ -4,7 +4,7 @@ import os from 'os';
import * as sqlite from '../src/platform/server/sqlite';
import * as db from '../src/server/db';
import { batchMessages, setSyncingMode } from '../src/server/sync';
-import { runQuery } from '../src/server/aql/schema/run-query';
+import { runQuery } from '../src/server/aql';
import asyncStorage from '../src/platform/server/asyncStorage';
import { makeChild } from '../src/shared/transactions';
import q from '../src/shared/query';
diff --git a/packages/loot-core/bin/sql-regenerate-views b/packages/loot-core/bin/sql-regenerate-views
index dd71b5f..eaa4906 100755
--- a/packages/loot-core/bin/sql-regenerate-views
+++ b/packages/loot-core/bin/sql-regenerate-views
@@ -1,5 +1,5 @@
#!/usr/bin/env actual-cli-runner.js
-const { schema } = require('../src/server/aql/schema');
+const { schema } = require('../src/server/aql');
const table = process.argv[3];
if (table == null || table === 'transactions') {
diff --git a/packages/loot-core/package.json b/packages/loot-core/package.json
index 27d13ff..72dbd19 100644
--- a/packages/loot-core/package.json
+++ b/packages/loot-core/package.json
@@ -35,12 +35,12 @@
"md5": "^2.3.0",
"mitt": "^2.1.0",
"node-fetch": "^1.6.3",
- "node-libofx": "workspace:*",
+ "node-libofx": "*",
"regenerator-runtime": "^0.13.7"
},
"devDependencies": {
- "@actual-app/api": "workspace:*",
- "@actual-app/import-ynab4": "workspace:*",
+ "@actual-app/api": "*",
+ "@actual-app/import-ynab4": "*",
"@babel/core": "~7.14.3",
"@types/jest": "^27.5.0",
"adm-zip": "^0.5.9",
@@ -50,6 +50,7 @@
"damerau-levenshtein": "^1.0.4",
"date-fns": "2.0.0-alpha.27",
"eslint": "5.6.0",
+ "eslint-plugin-import": "^2.26.0",
"eslint-plugin-prettier": "^3.1.4",
"esm": "^3.0.82",
"fake-indexeddb": "^3.1.3",
diff --git a/packages/loot-core/src/client/SpreadsheetProvider.js b/packages/loot-core/src/client/SpreadsheetProvider.js
index aedacbe..dd0bc45 100644
--- a/packages/loot-core/src/client/SpreadsheetProvider.js
+++ b/packages/loot-core/src/client/SpreadsheetProvider.js
@@ -1,7 +1,9 @@
-import * as React from 'react';
-import { useEffect, useMemo } from 'react';
+import React, { useEffect, useMemo } from 'react';
+
import LRU from 'lru-cache';
+
import SpreadsheetContext from 'loot-design/src/components/spreadsheet/SpreadsheetContext';
+
import { listen, send } from '../platform/client/fetch';
function makeSpreadsheet() {
diff --git a/packages/loot-core/src/client/actions/account.js b/packages/loot-core/src/client/actions/account.js
index 980f4dd..13b7643 100644
--- a/packages/loot-core/src/client/actions/account.js
+++ b/packages/loot-core/src/client/actions/account.js
@@ -1,7 +1,7 @@
import { send } from '../../platform/client/fetch';
import constants from '../constants';
-import { getPayees, getAccounts } from './queries';
import { addNotification } from './notifications';
+import { getPayees, getAccounts } from './queries';
export function setAccountsSyncing(name) {
return {
diff --git a/packages/loot-core/src/client/actions/budgets.js b/packages/loot-core/src/client/actions/budgets.js
index d370b01..0a84351 100644
--- a/packages/loot-core/src/client/actions/budgets.js
+++ b/packages/loot-core/src/client/actions/budgets.js
@@ -1,10 +1,11 @@
+import { send } from '../../platform/client/fetch';
+import { getDownloadError } from '../../shared/errors';
import constants from '../constants';
+import { setAppState } from './app';
import { closeModal, pushModal } from './modals';
import { loadPrefs, loadGlobalPrefs } from './prefs';
-import { send } from '../../platform/client/fetch';
-import { setAppState } from './app';
import { startTutorialFirstTime } from './tutorial';
-import { getDownloadError } from '../../shared/errors';
+
const uuid = require('../../platform/uuid');
export function updateStatusText(text) {
diff --git a/packages/loot-core/src/client/actions/notifications.js b/packages/loot-core/src/client/actions/notifications.js
index 1a2f236..52eb7e4 100644
--- a/packages/loot-core/src/client/actions/notifications.js
+++ b/packages/loot-core/src/client/actions/notifications.js
@@ -1,4 +1,5 @@
import constants from '../constants';
+
const uuid = require('../../platform/uuid');
export function addNotification(notification) {
diff --git a/packages/loot-core/src/client/actions/prefs.js b/packages/loot-core/src/client/actions/prefs.js
index f2a6388..5bda315 100644
--- a/packages/loot-core/src/client/actions/prefs.js
+++ b/packages/loot-core/src/client/actions/prefs.js
@@ -1,6 +1,6 @@
+import { send } from '../../platform/client/fetch';
import constants from '../constants';
import { closeModal } from './modals';
-import { send } from '../../platform/client/fetch';
export function loadPrefs() {
return async (dispatch, getState) => {
diff --git a/packages/loot-core/src/client/actions/queries.js b/packages/loot-core/src/client/actions/queries.js
index e42ea7a..2fa3fc8 100644
--- a/packages/loot-core/src/client/actions/queries.js
+++ b/packages/loot-core/src/client/actions/queries.js
@@ -1,8 +1,9 @@
import throttle from 'throttleit';
+
import { send } from '../../platform/client/fetch';
import constants from '../constants';
-import { addNotification, addGenericErrorNotification } from './notifications';
import { pushModal } from './modals';
+import { addNotification, addGenericErrorNotification } from './notifications';
export function applyBudgetAction(month, type, args) {
return async function() {
diff --git a/packages/loot-core/src/client/actions/sync.js b/packages/loot-core/src/client/actions/sync.js
index f081689..14e5254 100644
--- a/packages/loot-core/src/client/actions/sync.js
+++ b/packages/loot-core/src/client/actions/sync.js
@@ -1,9 +1,9 @@
import { send } from '../../platform/client/fetch';
+import { getUploadError } from '../../shared/errors';
import constants from '../constants';
-import { loadPrefs } from './prefs';
import { syncAccounts } from './account';
import { pushModal } from './modals';
-import { getUploadError } from '../../shared/errors';
+import { loadPrefs } from './prefs';
export function unregister() {
return async dispatch => {
diff --git a/packages/loot-core/src/client/actions/user.js b/packages/loot-core/src/client/actions/user.js
index 5666b2f..a3168f1 100644
--- a/packages/loot-core/src/client/actions/user.js
+++ b/packages/loot-core/src/client/actions/user.js
@@ -1,7 +1,7 @@
import { send } from '../../platform/client/fetch';
import constants from '../constants';
-import { loadGlobalPrefs } from './prefs';
import { loadAllFiles, closeBudget } from './budgets';
+import { loadGlobalPrefs } from './prefs';
export function getUserData() {
return async dispatch => {
diff --git a/packages/loot-core/src/client/data-hooks/accounts.js b/packages/loot-core/src/client/data-hooks/accounts.js
index c665939..405ad6b 100644
--- a/packages/loot-core/src/client/data-hooks/accounts.js
+++ b/packages/loot-core/src/client/data-hooks/accounts.js
@@ -1,4 +1,5 @@
import React, { useEffect, useState, useContext } from 'react';
+
import q, { liveQuery } from 'loot-core/src/client/query-helpers';
import { getAccountsById } from 'loot-core/src/client/reducers/queries';
diff --git a/packages/loot-core/src/client/data-hooks/payees.js b/packages/loot-core/src/client/data-hooks/payees.js
index 5cae0b9..b8383aa 100644
--- a/packages/loot-core/src/client/data-hooks/payees.js
+++ b/packages/loot-core/src/client/data-hooks/payees.js
@@ -1,4 +1,5 @@
import React, { useEffect, useState, useContext } from 'react';
+
import q, { liveQuery } from 'loot-core/src/client/query-helpers';
import { getPayeesById } from 'loot-core/src/client/reducers/queries';
diff --git a/packages/loot-core/src/client/data-hooks/schedules.js b/packages/loot-core/src/client/data-hooks/schedules.js
index 7cd0438..6cb01a4 100644
--- a/packages/loot-core/src/client/data-hooks/schedules.js
+++ b/packages/loot-core/src/client/data-hooks/schedules.js
@@ -1,9 +1,10 @@
import React, { useEffect, useState, useContext } from 'react';
+
+import q, { liveQuery } from 'loot-core/src/client/query-helpers';
import {
getStatus,
getHasTransactionsQuery
} from 'loot-core/src/shared/schedules';
-import q, { liveQuery } from 'loot-core/src/client/query-helpers';
function loadStatuses(schedules, onData) {
return liveQuery(getHasTransactionsQuery(schedules), onData, {
diff --git a/packages/loot-core/src/client/queries.js b/packages/loot-core/src/client/queries.js
index 7ce78ad..f109196 100644
--- a/packages/loot-core/src/client/queries.js
+++ b/packages/loot-core/src/client/queries.js
@@ -1,5 +1,5 @@
import { parse as parseDate, isValid as isDateValid } from 'date-fns';
-import { currencyToAmount, amountToInteger } from '../shared/util';
+
import {
dayFromDate,
getDayMonthRegex,
@@ -8,6 +8,7 @@ import {
getShortYearFormat
} from '../shared/months';
import q from '../shared/query';
+import { currencyToAmount, amountToInteger } from '../shared/util';
function isInteger(num) {
return (num | 0) === num;
diff --git a/packages/loot-core/src/client/query-helpers.js b/packages/loot-core/src/client/query-helpers.js
index b1a1d83..0a9b2a8 100644
--- a/packages/loot-core/src/client/query-helpers.js
+++ b/packages/loot-core/src/client/query-helpers.js
@@ -1,6 +1,5 @@
import { listen, send } from '../platform/client/fetch';
import { once } from '../shared/async';
-
import q, { getPrimaryOrderBy } from '../shared/query';
export default q;
diff --git a/packages/loot-core/src/client/query-helpers.test.js b/packages/loot-core/src/client/query-helpers.test.js
index 5f92afa..0c68ccb 100644
--- a/packages/loot-core/src/client/query-helpers.test.js
+++ b/packages/loot-core/src/client/query-helpers.test.js
@@ -1,8 +1,8 @@
import { initServer, serverPush } from '../platform/client/fetch';
-import q from '../shared/query';
-import { runQuery, liveQuery, pagedQuery } from './query-helpers';
-import { tracer } from '../shared/test-helpers';
import { subDays } from '../shared/months';
+import q from '../shared/query';
+import { tracer } from '../shared/test-helpers';
+import { runQuery, liveQuery, pagedQuery } from './query-helpers';
function wait(n) {
return new Promise(resolve => setTimeout(() => resolve(`wait(${n})`), n));
diff --git a/packages/loot-core/src/client/query-hooks.js b/packages/loot-core/src/client/query-hooks.js
index 6c680f4..97ef446 100644
--- a/packages/loot-core/src/client/query-hooks.js
+++ b/packages/loot-core/src/client/query-hooks.js
@@ -1,4 +1,5 @@
import React, { useState, useContext, useMemo, useEffect } from 'react';
+
import { runQuery, liveQuery, LiveQuery, PagedQuery } from './query-helpers';
function makeContext(queryState, opts, QueryClass) {
diff --git a/packages/loot-core/src/client/reducers/index.js b/packages/loot-core/src/client/reducers/index.js
index dbdab50..bd61c35 100644
--- a/packages/loot-core/src/client/reducers/index.js
+++ b/packages/loot-core/src/client/reducers/index.js
@@ -1,12 +1,12 @@
-import app from './app';
-import queries from './queries';
import account from './account';
+import app from './app';
+import budgets from './budgets';
import debug from './debug';
-import profile from './profile';
-import prefs from './prefs';
import modals from './modals';
import notifications from './notifications';
-import budgets from './budgets';
+import prefs from './prefs';
+import profile from './profile';
+import queries from './queries';
import tutorial from './tutorial';
import user from './user';
diff --git a/packages/loot-core/src/client/reducers/prefs.js b/packages/loot-core/src/client/reducers/prefs.js
index 5874d8e..80c8048 100644
--- a/packages/loot-core/src/client/reducers/prefs.js
+++ b/packages/loot-core/src/client/reducers/prefs.js
@@ -1,5 +1,5 @@
-import constants from '../constants';
import { setNumberFormat } from '../../shared/util.js';
+import constants from '../constants';
const initialState = {
local: null,
diff --git a/packages/loot-core/src/client/reducers/queries.js b/packages/loot-core/src/client/reducers/queries.js
index c413744..bcb6fa2 100644
--- a/packages/loot-core/src/client/reducers/queries.js
+++ b/packages/loot-core/src/client/reducers/queries.js
@@ -1,6 +1,7 @@
-import constants from '../constants';
import memoizeOne from 'memoize-one';
+
import { groupById } from '../../shared/util';
+import constants from '../constants';
const initialState = {
newTransactions: [],
diff --git a/packages/loot-core/src/mocks/arbitrary-schema.js b/packages/loot-core/src/mocks/arbitrary-schema.js
index 6b4d8d6..2fee695 100644
--- a/packages/loot-core/src/mocks/arbitrary-schema.js
+++ b/packages/loot-core/src/mocks/arbitrary-schema.js
@@ -1,5 +1,6 @@
import fc from 'fast-check';
-import { schema } from '../server/aql/schema';
+
+import { schema } from '../server/aql';
import { addDays } from '../shared/months';
function typeArbitrary(typeDesc, name) {
diff --git a/packages/loot-core/src/mocks/budget.js b/packages/loot-core/src/mocks/budget.js
index 5e03bf4..1439639 100644
--- a/packages/loot-core/src/mocks/budget.js
+++ b/packages/loot-core/src/mocks/budget.js
@@ -1,13 +1,13 @@
-import * as monthUtils from '../shared/months';
-import * as sheet from '../server/sheet';
+import { addTransactions } from '../server/accounts/sync';
+import { runQuery as aqlQuery } from '../server/aql';
+import * as budgetActions from '../server/budget/actions';
import * as budget from '../server/budget/base';
import * as db from '../server/db';
-import * as prefs from '../server/prefs';
-import * as budgetActions from '../server/budget/actions';
-import { runQuery as aqlQuery } from '../server/aql/schema/run-query';
-import { batchMessages, setSyncingMode } from '../server/sync';
import { runHandler, runMutator } from '../server/mutators';
-import { addTransactions } from '../server/accounts/sync';
+import * as prefs from '../server/prefs';
+import * as sheet from '../server/sheet';
+import { batchMessages, setSyncingMode } from '../server/sync';
+import * as monthUtils from '../shared/months';
import q from '../shared/query';
function pickRandom(list) {
diff --git a/packages/loot-core/src/mocks/index.js b/packages/loot-core/src/mocks/index.js
index a2423d8..ed2b174 100644
--- a/packages/loot-core/src/mocks/index.js
+++ b/packages/loot-core/src/mocks/index.js
@@ -1,4 +1,5 @@
import * as monthUtils from '../shared/months';
+
const uuid = require('../platform/uuid');
export function generateAccount(name, isConnected, type, offbudget) {
diff --git a/packages/loot-core/src/mocks/redux.js b/packages/loot-core/src/mocks/redux.js
index 4c0a15f..f47efea 100644
--- a/packages/loot-core/src/mocks/redux.js
+++ b/packages/loot-core/src/mocks/redux.js
@@ -1,7 +1,9 @@
import React from 'react';
import { Provider } from 'react-redux';
-import thunk from 'redux-thunk';
+
import { createStore, combineReducers, applyMiddleware } from 'redux';
+import thunk from 'redux-thunk';
+
import reducers from '../client/reducers';
let appReducer = combineReducers(reducers);
diff --git a/packages/loot-core/src/mocks/setup.js b/packages/loot-core/src/mocks/setup.js
index 861ba58..40ef7b4 100644
--- a/packages/loot-core/src/mocks/setup.js
+++ b/packages/loot-core/src/mocks/setup.js
@@ -1,16 +1,16 @@
-import * as sqlite from '../platform/server/sqlite';
import * as fetchClient from '../platform/client/fetch';
-import * as db from '../server/db';
-import * as sheet from '../server/sheet';
+import * as sqlite from '../platform/server/sqlite';
import * as rules from '../server/accounts/transaction-rules';
-import * as tracking from '../server/tracking/events';
-import { setSyncingMode } from '../server/sync';
-import { updateVersion } from '../server/update';
-import { resetTracer, tracer } from '../shared/test-helpers';
+import * as db from '../server/db';
import {
enableGlobalMutations,
disableGlobalMutations
} from '../server/mutators';
+import * as sheet from '../server/sheet';
+import { setSyncingMode } from '../server/sync';
+import * as tracking from '../server/tracking/events';
+import { updateVersion } from '../server/update';
+import { resetTracer, tracer } from '../shared/test-helpers';
jest.mock('../server/post');
diff --git a/packages/loot-core/src/mocks/util.js b/packages/loot-core/src/mocks/util.js
index c430538..9508b0e 100644
--- a/packages/loot-core/src/mocks/util.js
+++ b/packages/loot-core/src/mocks/util.js
@@ -1,6 +1,7 @@
-const snapshotDiff = require('snapshot-diff');
const { join, dirname, basename } = require('path');
+const snapshotDiff = require('snapshot-diff');
+
export function expectSnapshotWithDiffer(initialValue, { onlyUpdates } = {}) {
let currentValue = initialValue;
if (!onlyUpdates) {
diff --git a/packages/loot-core/src/platform/client/fetch/index.browser.js b/packages/loot-core/src/platform/client/fetch/index.browser.js
index a375a3a..369c2dc 100644
--- a/packages/loot-core/src/platform/client/fetch/index.browser.js
+++ b/packages/loot-core/src/platform/client/fetch/index.browser.js
@@ -1,6 +1,6 @@
-const undo = require('../undo');
const { captureException, captureBreadcrumb } = require('../../exceptions');
const uuid = require('../../uuid');
+const undo = require('../undo');
let replyHandlers = new Map();
let listeners = new Map();
let messageQueue = [];
diff --git a/packages/loot-core/src/platform/client/fetch/index.web.js b/packages/loot-core/src/platform/client/fetch/index.web.js
index 37d8880..c52f65a 100644
--- a/packages/loot-core/src/platform/client/fetch/index.web.js
+++ b/packages/loot-core/src/platform/client/fetch/index.web.js
@@ -1,5 +1,5 @@
-const undo = require('../undo');
const uuid = require('../../uuid');
+const undo = require('../undo');
let replyHandlers = new Map();
let listeners = new Map();
let messageQueue = [];
diff --git a/packages/loot-core/src/platform/client/undo/index.web.js b/packages/loot-core/src/platform/client/undo/index.web.js
index 0e716a2..bd57f41 100644
--- a/packages/loot-core/src/platform/client/undo/index.web.js
+++ b/packages/loot-core/src/platform/client/undo/index.web.js
@@ -1,5 +1,5 @@
-const uuid = require('../../uuid');
const { getChangedValues } = require('../../../shared/util');
+const uuid = require('../../uuid');
// List of recently used states. We don't use a true MRU structure
// because our needs are simple and we also do some custom reordering.
diff --git a/packages/loot-core/src/platform/server/asyncStorage/index.electron.js b/packages/loot-core/src/platform/server/asyncStorage/index.electron.js
index b94b742..b2a8853 100644
--- a/packages/loot-core/src/platform/server/asyncStorage/index.electron.js
+++ b/packages/loot-core/src/platform/server/asyncStorage/index.electron.js
@@ -1,7 +1,8 @@
-const lootFs = require('../fs');
const fs = require('fs');
const { join } = require('path');
+const lootFs = require('../fs');
+
let getStorePath = () => join(lootFs.getDataDir(), 'global-store.json');
let store;
let persisted = true;
diff --git a/packages/loot-core/src/platform/server/connection/index.electron.js b/packages/loot-core/src/platform/server/connection/index.electron.js
index 3bd2b15..f31ab61 100644
--- a/packages/loot-core/src/platform/server/connection/index.electron.js
+++ b/packages/loot-core/src/platform/server/connection/index.electron.js
@@ -1,5 +1,6 @@
-const { runHandler, isMutating } = require('../../../server/mutators');
const ipc = require('node-ipc');
+
+const { runHandler, isMutating } = require('../../../server/mutators');
const { captureException } = require('../../exceptions');
function coerceError(error) {
diff --git a/packages/loot-core/src/platform/server/connection/index.mobile.js b/packages/loot-core/src/platform/server/connection/index.mobile.js
index c11f0c0..02e1307 100644
--- a/packages/loot-core/src/platform/server/connection/index.mobile.js
+++ b/packages/loot-core/src/platform/server/connection/index.mobile.js
@@ -1,6 +1,7 @@
+let rn_bridge = require('rn-bridge');
+
const { runHandler } = require('../../../server/mutators');
let { captureException } = require('../../exceptions');
-let rn_bridge = require('rn-bridge');
function coerceError(error) {
if (error.type && error.type === 'APIError') {
diff --git a/packages/loot-core/src/platform/server/fetch/index.electron.js b/packages/loot-core/src/platform/server/fetch/index.electron.js
index ebad971..a553219 100644
--- a/packages/loot-core/src/platform/server/fetch/index.electron.js
+++ b/packages/loot-core/src/platform/server/fetch/index.electron.js
@@ -1,4 +1,5 @@
let fs = require('fs');
+
let fetch = require('node-fetch');
async function fetchBinary(url, filepath) {
diff --git a/packages/loot-core/src/platform/server/fs/index.mobile.js b/packages/loot-core/src/platform/server/fs/index.mobile.js
index b8af10e..53ec5b2 100644
--- a/packages/loot-core/src/platform/server/fs/index.mobile.js
+++ b/packages/loot-core/src/platform/server/fs/index.mobile.js
@@ -1,4 +1,5 @@
let path = require('path');
+
let fs = require('./index.electron.js');
// On mobile, the backend runs from a single bundle mounted at the
diff --git a/packages/loot-core/src/platform/server/fs/index.web.js b/packages/loot-core/src/platform/server/fs/index.web.js
index 591824f..cdb0853 100644
--- a/packages/loot-core/src/platform/server/fs/index.web.js
+++ b/packages/loot-core/src/platform/server/fs/index.web.js
@@ -1,8 +1,9 @@
let { SQLiteFS } = require('absurd-sql');
let IndexedDBBackend = require('absurd-sql/dist/indexeddb-backend').default;
+
let connection = require('../connection');
-let { _getModule } = require('../sqlite');
let idb = require('../indexeddb');
+let { _getModule } = require('../sqlite');
let baseAPI = require('./index.electron.js');
let join = require('./path-join');
diff --git a/packages/loot-core/src/platform/server/fs/index.web.test.js b/packages/loot-core/src/platform/server/fs/index.web.test.js
index 965b3e9..c83f50f 100644
--- a/packages/loot-core/src/platform/server/fs/index.web.test.js
+++ b/packages/loot-core/src/platform/server/fs/index.web.test.js
@@ -4,6 +4,7 @@ require('fake-indexeddb/auto');
let FDBFactory = require('fake-indexeddb/lib/FDBFactory');
let idb = require('../indexeddb');
+
let { init, readFile, writeFile, exists, pathToId, join } = require('./index');
beforeAll(() => {
diff --git a/packages/loot-core/src/platform/server/sqlite/index.web.test.js b/packages/loot-core/src/platform/server/sqlite/index.web.test.js
index 377516f..3d343f1 100644
--- a/packages/loot-core/src/platform/server/sqlite/index.web.test.js
+++ b/packages/loot-core/src/platform/server/sqlite/index.web.test.js
@@ -5,6 +5,7 @@ import {
execQuery,
runQuery
} from './index.web';
+
let os = require('os');
beforeAll(() => {
diff --git a/packages/loot-core/src/server/accounts/export-to-csv.js b/packages/loot-core/src/server/accounts/export-to-csv.js
index 64b9f6e..6ca03cd 100644
--- a/packages/loot-core/src/server/accounts/export-to-csv.js
+++ b/packages/loot-core/src/server/accounts/export-to-csv.js
@@ -1,6 +1,7 @@
import csvStringify from 'csv-stringify/lib/sync';
-import { runQuery as aqlQuery } from '../aql/schema/run-query';
+
import { integerToAmount } from '../../shared/util';
+import { runQuery as aqlQuery } from '../aql';
export async function exportToCSV(
transactions,
diff --git a/packages/loot-core/src/server/accounts/link.js b/packages/loot-core/src/server/accounts/link.js
index 7f97be6..9ba08b2 100644
--- a/packages/loot-core/src/server/accounts/link.js
+++ b/packages/loot-core/src/server/accounts/link.js
@@ -1,11 +1,12 @@
import asyncStorage from '../../platform/server/asyncStorage';
-import * as db from '../db';
-import { getServer } from '../server-config';
-import * as bankSync from './sync';
import { fromPlaidAccountType } from '../../shared/accounts';
import { amountToInteger } from '../../shared/util';
-import { post } from '../post';
+import * as db from '../db';
import { runMutator } from '../mutators';
+import { post } from '../post';
+import { getServer } from '../server-config';
+import * as bankSync from './sync';
+
const uuid = require('../../platform/uuid');
export async function handoffPublicToken(institution, publicToken) {
diff --git a/packages/loot-core/src/server/accounts/parse-file.js b/packages/loot-core/src/server/accounts/parse-file.js
index 8887195..dfa461e 100644
--- a/packages/loot-core/src/server/accounts/parse-file.js
+++ b/packages/loot-core/src/server/accounts/parse-file.js
@@ -1,8 +1,9 @@
-import fs from '../../platform/server/fs';
-import qif2json from './qif2json';
import csv2json from 'csv-parse/lib/sync';
+
+import fs from '../../platform/server/fs';
import { dayFromDate } from '../../shared/months';
import { looselyParseAmount } from '../../shared/util';
+import qif2json from './qif2json';
export function parseFile(filepath, options) {
let errors = [];
diff --git a/packages/loot-core/src/server/accounts/parse-file.test.js b/packages/loot-core/src/server/accounts/parse-file.test.js
index 0c47088..ee3cc1a 100644
--- a/packages/loot-core/src/server/accounts/parse-file.test.js
+++ b/packages/loot-core/src/server/accounts/parse-file.test.js
@@ -1,9 +1,10 @@
+import * as d from 'date-fns';
+
+import { amountToInteger } from '../../shared/util';
+import * as db from '../db';
+import * as prefs from '../prefs';
import { parseFile } from './parse-file';
import { reconcileTransactions } from './sync';
-import * as prefs from '../prefs';
-import * as db from '../db';
-import { amountToInteger } from '../../shared/util';
-import * as d from 'date-fns';
beforeEach(global.emptyDatabase());
diff --git a/packages/loot-core/src/server/accounts/rules.js b/packages/loot-core/src/server/accounts/rules.js
index 798cd09..3667bf0 100644
--- a/packages/loot-core/src/server/accounts/rules.js
+++ b/packages/loot-core/src/server/accounts/rules.js
@@ -1,5 +1,5 @@
-import { RuleError } from '../errors';
import * as dateFns from 'date-fns';
+
import {
monthFromDate,
yearFromDate,
@@ -9,9 +9,10 @@ import {
subDays,
parseDate
} from '../../shared/months';
-import { fastSetMerge } from '../../shared/util';
import { sortNumbers, getApproxNumberThreshold } from '../../shared/rules';
import { recurConfigToRSchedule } from '../../shared/schedules';
+import { fastSetMerge } from '../../shared/util';
+import { RuleError } from '../errors';
import { Schedule as RSchedule } from '../util/rschedule';
function safeNumber(n) {
diff --git a/packages/loot-core/src/server/accounts/sync.js b/packages/loot-core/src/server/accounts/sync.js
index 2106fda..b242d02 100644
--- a/packages/loot-core/src/server/accounts/sync.js
+++ b/packages/loot-core/src/server/accounts/sync.js
@@ -1,22 +1,23 @@
-import title from './title';
-import * as db from '../db';
-import { hasFieldsChanged, amountToInteger } from '../../shared/util';
+import * as monthUtils from '../../shared/months';
import {
makeChild as makeChildTransaction,
recalculateSplit
} from '../../shared/transactions';
-import * as monthUtils from '../../shared/months';
+import { hasFieldsChanged, amountToInteger } from '../../shared/util';
+import * as db from '../db';
+import { runMutator } from '../mutators';
import { getServer } from '../server-config';
import { batchMessages } from '../sync';
-import { runMutator } from '../mutators';
import { getStartingBalancePayee } from './payees';
+import title from './title';
import { runRules } from './transaction-rules';
import { batchUpdateTransactions } from './transactions';
-const dateFns = require('date-fns');
-const { post } = require('../post');
const levenshtein = require('damerau-levenshtein');
+const dateFns = require('date-fns');
+
const uuid = require('../../platform/uuid');
+const { post } = require('../post');
// Plaid article about API options:
// https://support.plaid.com/customer/en/portal/articles/2612155-transactions-returned-per-request
diff --git a/packages/loot-core/src/server/accounts/sync.test.js b/packages/loot-core/src/server/accounts/sync.test.js
index 0ab189a..2f14a55 100644
--- a/packages/loot-core/src/server/accounts/sync.test.js
+++ b/packages/loot-core/src/server/accounts/sync.test.js
@@ -1,3 +1,4 @@
+import * as monthUtils from '../../shared/months';
import * as db from '../db';
import { loadMappings } from '../db/mappings';
import { getServer } from '../server-config';
@@ -7,10 +8,11 @@ import {
addTransactions,
fromPlaid
} from './sync';
-import * as monthUtils from '../../shared/months';
-import * as transfer from './transfer';
import { loadRules, insertRule } from './transaction-rules';
+import * as transfer from './transfer';
+
const snapshotDiff = require('snapshot-diff');
+
const { post } = require('../post');
const mockSyncServer = require('../tests/mockSyncServer');
diff --git a/packages/loot-core/src/server/accounts/transaction-rules.js b/packages/loot-core/src/server/accounts/transaction-rules.js
index 794f428..26309cb 100644
--- a/packages/loot-core/src/server/accounts/transaction-rules.js
+++ b/packages/loot-core/src/server/accounts/transaction-rules.js
@@ -1,4 +1,23 @@
+import {
+ currentDay,
+ addDays,
+ subDays,
+ parseDate,
+ dayFromDate
+} from '../../shared/months';
+import {
+ FIELD_TYPES,
+ sortNumbers,
+ getApproxNumberThreshold
+} from '../../shared/rules';
+import { partitionByField, fastSetMerge } from '../../shared/util';
+import { schemaConfig } from '../aql';
import * as db from '../db';
+import { getMappings } from '../db/mappings';
+import { RuleError } from '../errors';
+import { requiredFields, toDateRepr } from '../models';
+import { setSyncingMode, batchMessages } from '../sync';
+import { addSyncListener } from '../sync/index';
import {
Condition,
Action,
@@ -8,20 +27,6 @@ import {
migrateIds,
iterateIds
} from './rules';
-import { getMappings } from '../db/mappings';
-import { addDays, subDays, parseDate, dayFromDate } from '../../shared/months';
-import { addSyncListener } from '../sync/index';
-import { RuleError } from '../errors';
-import {
- FIELD_TYPES,
- sortNumbers,
- getApproxNumberThreshold
-} from '../../shared/rules';
-import { requiredFields, toDateRepr } from '../models';
-import { currentDay } from '../../shared/months';
-import { partitionByField, fastSetMerge } from '../../shared/util';
-import { setSyncingMode, batchMessages } from '../sync';
-import { schemaConfig } from '../aql/schema';
// TODO: Detect if it looks like the user is creating a rename rule
// and prompt to create it in the pre phase instead
diff --git a/packages/loot-core/src/server/accounts/transaction-rules.test.js b/packages/loot-core/src/server/accounts/transaction-rules.test.js
index d35653c..eb57fe4 100644
--- a/packages/loot-core/src/server/accounts/transaction-rules.test.js
+++ b/packages/loot-core/src/server/accounts/transaction-rules.test.js
@@ -1,4 +1,7 @@
+import q from '../../shared/query';
+import { runQuery } from '../aql';
import * as db from '../db';
+import { loadMappings } from '../db/mappings';
import {
getRules,
loadRules,
@@ -13,9 +16,6 @@ import {
updateCategoryRules,
migrateOldRules
} from './transaction-rules';
-import { loadMappings } from '../db/mappings';
-import { runQuery } from '../aql/schema/run-query';
-import q from '../../shared/query';
// TODO: write tests to make sure payee renaming is "pre" and category
// setting is "null" stage
diff --git a/packages/loot-core/src/server/accounts/transactions.js b/packages/loot-core/src/server/accounts/transactions.js
index 092379e..e7a8744 100644
--- a/packages/loot-core/src/server/accounts/transactions.js
+++ b/packages/loot-core/src/server/accounts/transactions.js
@@ -1,8 +1,9 @@
-import { batchMessages } from '../sync';
import * as db from '../db';
import { incrFetch, whereIn } from '../db/util';
-import * as transfer from './transfer';
+import { batchMessages } from '../sync';
import * as rules from './transaction-rules';
+import * as transfer from './transfer';
+
const connection = require('../../platform/server/connection');
async function idsWithChildren(ids) {
diff --git a/packages/loot-core/src/server/accounts/transfer.test.js b/packages/loot-core/src/server/accounts/transfer.test.js
index 9caf19d..7d3b6e2 100644
--- a/packages/loot-core/src/server/accounts/transfer.test.js
+++ b/packages/loot-core/src/server/accounts/transfer.test.js
@@ -1,6 +1,6 @@
+import { expectSnapshotWithDiffer } from '../../mocks/util';
import * as db from '../db';
import * as transfer from './transfer';
-import { expectSnapshotWithDiffer } from '../../mocks/util';
beforeEach(global.emptyDatabase());
diff --git a/packages/loot-core/src/server/api.js b/packages/loot-core/src/server/api.js
index 460fa58..a798482 100644
--- a/packages/loot-core/src/server/api.js
+++ b/packages/loot-core/src/server/api.js
@@ -1,3 +1,11 @@
+import * as monthUtils from '../shared/months';
+import q from '../shared/query';
+import {
+ ungroupTransactions,
+ updateTransaction,
+ deleteTransaction
+} from '../shared/transactions';
+import { integerToAmount } from '../shared/util';
import { addTransactions } from './accounts/sync';
import {
accountModel,
@@ -6,22 +14,14 @@ import {
payeeModel,
payeeRuleModel
} from './api-models';
-import {
- ungroupTransactions,
- updateTransaction,
- deleteTransaction
-} from '../shared/transactions';
-import * as db from './db';
-import * as sheet from './sheet';
-import * as prefs from './prefs';
-import * as monthUtils from '../shared/months';
+import { runQuery as aqlQuery } from './aql';
import * as cloudStorage from './cloud-storage';
-import { setSyncingMode, batchMessages } from './sync';
import { getClock } from './crdt';
+import * as db from './db';
import { runMutator } from './mutators';
-import { integerToAmount } from '../shared/util';
-import { runQuery as aqlQuery } from './aql/schema/run-query';
-import q from '../shared/query';
+import * as prefs from './prefs';
+import * as sheet from './sheet';
+import { setSyncingMode, batchMessages } from './sync';
const connection = require('../platform/server/connection');
diff --git a/packages/loot-core/src/server/app.js b/packages/loot-core/src/server/app.js
index c1740ef..964398e 100644
--- a/packages/loot-core/src/server/app.js
+++ b/packages/loot-core/src/server/app.js
@@ -1,4 +1,5 @@
import mitt from 'mitt';
+
import { captureException } from '../platform/exceptions';
// This is a simple helper abstraction for defining methods exposed to
diff --git a/packages/loot-core/src/server/aql/exec.test.js b/packages/loot-core/src/server/aql/exec.test.js
index f64ab12..7f854ba 100644
--- a/packages/loot-core/src/server/aql/exec.test.js
+++ b/packages/loot-core/src/server/aql/exec.test.js
@@ -1,8 +1,9 @@
-import * as db from '../db';
import query from '../../shared/query';
import { makeChild } from '../../shared/transactions';
+import * as db from '../db';
import * as aql from './exec';
import { schema, schemaConfig } from './schema';
+
const uuid = require('../../platform/uuid');
beforeEach(global.emptyDatabase());
diff --git a/packages/loot-core/src/server/aql/index.js b/packages/loot-core/src/server/aql/index.js
new file mode 100644
index 0000000..493010c
--- /dev/null
+++ b/packages/loot-core/src/server/aql/index.js
@@ -0,0 +1,10 @@
+export {
+ convertForInsert,
+ convertForUpdate,
+ convertFromSelect,
+ convertInputType
+} from './schema-helpers';
+export { compileQuery } from './compiler';
+export { makeViews } from './views';
+export { schema, schemaConfig } from './schema';
+export { runQuery, runCompiledQuery } from './schema/run-query';
diff --git a/packages/loot-core/src/server/aql/schema-helpers.js b/packages/loot-core/src/server/aql/schema-helpers.js
index 4140f7c..ef48c5f 100644
--- a/packages/loot-core/src/server/aql/schema-helpers.js
+++ b/packages/loot-core/src/server/aql/schema-helpers.js
@@ -1,5 +1,5 @@
-import { toDateRepr, fromDateRepr } from '../models';
import { dayFromDate } from '../../shared/months';
+import { toDateRepr, fromDateRepr } from '../models';
function isRequired(name, fieldDesc) {
return fieldDesc.required || name === 'id';
diff --git a/packages/loot-core/src/server/aql/schema/executors.js b/packages/loot-core/src/server/aql/schema/executors.js
index 5ab925f..d389eff 100644
--- a/packages/loot-core/src/server/aql/schema/executors.js
+++ b/packages/loot-core/src/server/aql/schema/executors.js
@@ -1,8 +1,8 @@
import * as db from '../../db';
import { whereIn } from '../../db/util';
import { isAggregateQuery } from '../compiler';
-import { convertOutputType } from '../schema-helpers';
import { execQuery } from '../exec';
+import { convertOutputType } from '../schema-helpers';
// Transactions executor
diff --git a/packages/loot-core/src/server/aql/schema/executors.test.js b/packages/loot-core/src/server/aql/schema/executors.test.js
index 0bd4a1a..6995358 100644
--- a/packages/loot-core/src/server/aql/schema/executors.test.js
+++ b/packages/loot-core/src/server/aql/schema/executors.test.js
@@ -1,12 +1,13 @@
import fc from 'fast-check';
-import * as db from '../../db';
-import query from '../../../shared/query';
-import { batchMessages, setSyncingMode } from '../../sync/index';
-import { setClock } from '../../crdt';
-import { groupById } from '../../../shared/util';
+
import arbs from '../../../mocks/arbitrary-schema';
-import { runQuery } from './run-query';
+import query from '../../../shared/query';
+import { groupById } from '../../../shared/util';
+import { setClock } from '../../crdt';
+import * as db from '../../db';
+import { batchMessages, setSyncingMode } from '../../sync/index';
import { isHappyPathQuery } from './executors';
+import { runQuery } from './run-query';
beforeEach(global.emptyDatabase());
diff --git a/packages/loot-core/src/server/aql/schema/run-query.js b/packages/loot-core/src/server/aql/schema/run-query.js
index f32847e..ec47f5b 100644
--- a/packages/loot-core/src/server/aql/schema/run-query.js
+++ b/packages/loot-core/src/server/aql/schema/run-query.js
@@ -1,10 +1,11 @@
-import { schema, schemaConfig } from './index';
-import schemaExecutors from './executors';
+import { Query } from '../../../shared/query';
import {
runQuery as _runQuery,
runCompiledQuery as _runCompiledQuery
} from '../exec';
-import { Query } from '../../../shared/query';
+import schemaExecutors from './executors';
+
+import { schema, schemaConfig } from './index';
export function runCompiledQuery(query, sqlPieces, state, params) {
return _runCompiledQuery(query, sqlPieces, state, {
diff --git a/packages/loot-core/src/server/backups.js b/packages/loot-core/src/server/backups.js
index cba241a..5a46237 100644
--- a/packages/loot-core/src/server/backups.js
+++ b/packages/loot-core/src/server/backups.js
@@ -1,11 +1,13 @@
import fs from '../platform/server/fs';
-import * as monthUtils from '../shared/months';
import * as sqlite from '../platform/server/sqlite';
-import * as prefs from './prefs';
+import * as monthUtils from '../shared/months';
import * as cloudStorage from './cloud-storage';
+import * as prefs from './prefs';
+
+const dateFns = require('date-fns');
+
const connection = require('../platform/server/connection');
const uuid = require('../platform/uuid');
-const dateFns = require('date-fns');
// A special backup that represents the latest version of the db that
// can be reverted to after loading a backup
diff --git a/packages/loot-core/src/server/backups.test.js b/packages/loot-core/src/server/backups.test.js
index 35b7dc7..a1c86cb 100644
--- a/packages/loot-core/src/server/backups.test.js
+++ b/packages/loot-core/src/server/backups.test.js
@@ -1,4 +1,5 @@
import { updateBackups } from './backups';
+
const dateFns = require('date-fns');
describe('Backups', () => {
diff --git a/packages/loot-core/src/server/budget/actions.js b/packages/loot-core/src/server/budget/actions.js
index 1f20a7a..e3201ca 100644
--- a/packages/loot-core/src/server/budget/actions.js
+++ b/packages/loot-core/src/server/budget/actions.js
@@ -1,8 +1,8 @@
import * as monthUtils from '../../shared/months';
import * as db from '../db';
-import { batchMessages } from '../sync';
import * as prefs from '../prefs';
import * as sheet from '../sheet';
+import { batchMessages } from '../sync';
async function getSheetValue(sheetName, cell) {
const node = await sheet.getCell(sheetName, cell);
diff --git a/packages/loot-core/src/server/budget/base.js b/packages/loot-core/src/server/budget/base.js
index 139b0cb..5aa4a04 100644
--- a/packages/loot-core/src/server/budget/base.js
+++ b/packages/loot-core/src/server/budget/base.js
@@ -1,12 +1,12 @@
-import * as sheet from '../sheet';
-import * as db from '../db';
import * as monthUtils from '../../shared/months';
import { getChangedValues } from '../../shared/util';
+import * as db from '../db';
+import * as sheet from '../sheet';
import { resolveName } from '../spreadsheet/util';
+import * as budgetActions from './actions';
import * as report from './report';
import * as rollover from './rollover';
import { sumAmounts } from './util';
-import * as budgetActions from '../budget/actions';
function mergeUpdates(updates) {
const merged = {};
diff --git a/packages/loot-core/src/server/budget/base.test.js b/packages/loot-core/src/server/budget/base.test.js
index 6424c8d..0c58dea 100644
--- a/packages/loot-core/src/server/budget/base.test.js
+++ b/packages/loot-core/src/server/budget/base.test.js
@@ -1,6 +1,6 @@
-import * as sheet from '../sheet';
-import * as db from '../db';
import * as monthUtils from '../../shared/months';
+import * as db from '../db';
+import * as sheet from '../sheet';
import { createAllBudgets } from './base';
beforeEach(() => {
diff --git a/packages/loot-core/src/server/budget/report.js b/packages/loot-core/src/server/budget/report.js
index 150d050..90901f7 100644
--- a/packages/loot-core/src/server/budget/report.js
+++ b/packages/loot-core/src/server/budget/report.js
@@ -1,5 +1,6 @@
import * as sheet from '../sheet';
import { number, sumAmounts } from './util';
+
const { resolveName } = require('../spreadsheet/util');
export async function createCategory(cat, sheetName, prevSheetName) {
diff --git a/packages/loot-core/src/server/budget/rollover.js b/packages/loot-core/src/server/budget/rollover.js
index 5f5356f..1df8260 100644
--- a/packages/loot-core/src/server/budget/rollover.js
+++ b/packages/loot-core/src/server/budget/rollover.js
@@ -1,6 +1,7 @@
-import * as sheet from '../sheet';
import * as monthUtils from '../../shared/months';
+import * as sheet from '../sheet';
import { number, sumAmounts, flatten2, unflatten2 } from './util';
+
const { resolveName } = require('../spreadsheet/util');
function getBlankSheet(months) {
diff --git a/packages/loot-core/src/server/cloud-storage.js b/packages/loot-core/src/server/cloud-storage.js
index 498571d..bf41351 100644
--- a/packages/loot-core/src/server/cloud-storage.js
+++ b/packages/loot-core/src/server/cloud-storage.js
@@ -1,22 +1,24 @@
-import fs from '../platform/server/fs';
import asyncStorage from '../platform/server/asyncStorage';
import { fetch } from '../platform/server/fetch';
-import * as monthUtils from '../shared/months';
+import fs from '../platform/server/fs';
import * as sqlite from '../platform/server/sqlite';
-import * as prefs from './prefs';
-import { getServer } from './server-config';
-import { runMutator } from './mutators';
+import * as monthUtils from '../shared/months';
+import encryption from './encryption';
import {
HTTPError,
PostError,
FileDownloadError,
FileUploadError
} from './errors';
-import encryption from './encryption';
+import { runMutator } from './mutators';
import { post } from './post';
-let uuid = require('../platform/uuid');
+import * as prefs from './prefs';
+import { getServer } from './server-config';
+
let AdmZip = require('adm-zip');
+let uuid = require('../platform/uuid');
+
let UPLOAD_FREQUENCY_IN_DAYS = 7;
async function checkHTTPStatus(res) {
diff --git a/packages/loot-core/src/server/crdt/timestamp.js b/packages/loot-core/src/server/crdt/timestamp.js
index b78a161..cf1f5fa 100644
--- a/packages/loot-core/src/server/crdt/timestamp.js
+++ b/packages/loot-core/src/server/crdt/timestamp.js
@@ -1,4 +1,5 @@
import murmurhash from 'murmurhash';
+
const uuid = require('../../platform/uuid');
/**
diff --git a/packages/loot-core/src/server/db/index.js b/packages/loot-core/src/server/db/index.js
index 249ec84..0fb1d1c 100644
--- a/packages/loot-core/src/server/db/index.js
+++ b/packages/loot-core/src/server/db/index.js
@@ -1,16 +1,15 @@
import LRU from 'lru-cache';
-import * as sqlite from '../../platform/server/sqlite';
+
import fs from '../../platform/server/fs';
-import { sendMessages, batchMessages } from '../sync';
-import { schema, schemaConfig } from '../aql/schema';
-import {
- accountModel,
- categoryModel,
- categoryGroupModel,
- payeeModel,
- payeeRuleModel
-} from '../models';
+import * as sqlite from '../../platform/server/sqlite';
import { groupById } from '../../shared/util';
+import {
+ schema,
+ schemaConfig,
+ convertForInsert,
+ convertForUpdate,
+ convertFromSelect
+} from '../aql';
import {
makeClock,
setClock,
@@ -20,10 +19,13 @@ import {
Timestamp
} from '../crdt';
import {
- convertForInsert,
- convertForUpdate,
- convertFromSelect
-} from '../aql/schema-helpers';
+ accountModel,
+ categoryModel,
+ categoryGroupModel,
+ payeeModel,
+ payeeRuleModel
+} from '../models';
+import { sendMessages, batchMessages } from '../sync';
import { shoveSortOrders, SORT_INCREMENT } from './sort';
export { toDateRepr, fromDateRepr } from '../models';
diff --git a/packages/loot-core/src/server/db/mappings.js b/packages/loot-core/src/server/db/mappings.js
index 4c0f19f..91d0007 100644
--- a/packages/loot-core/src/server/db/mappings.js
+++ b/packages/loot-core/src/server/db/mappings.js
@@ -1,6 +1,7 @@
-import * as db from './index';
import { addSyncListener } from '../sync/index';
+import * as db from './index';
+
// This file keeps all the mappings in memory so we can access it
// synchronously. This is primarily used in the rules system, but
// there may be other uses in the future. You don't need to worry
diff --git a/packages/loot-core/src/server/encryption.js b/packages/loot-core/src/server/encryption.js
index 25018d7..1763c09 100644
--- a/packages/loot-core/src/server/encryption.js
+++ b/packages/loot-core/src/server/encryption.js
@@ -1,4 +1,5 @@
import * as internals from './encryption-internals';
+
let uuid = require('../platform/uuid/index.electron.js');
// A map of all possible master encryption keys to use, keyed by
diff --git a/packages/loot-core/src/server/main-app.js b/packages/loot-core/src/server/main-app.js
index 3080039..e3597cb 100644
--- a/packages/loot-core/src/server/main-app.js
+++ b/packages/loot-core/src/server/main-app.js
@@ -1,4 +1,5 @@
import { createApp } from './app';
+
const connection = require('../platform/server/connection');
// Main app
diff --git a/packages/loot-core/src/server/main.js b/packages/loot-core/src/server/main.js
index ac80260..f7f4106 100644
--- a/packages/loot-core/src/server/main.js
+++ b/packages/loot-core/src/server/main.js
@@ -1,20 +1,27 @@
import './polyfills';
-import asyncStorage from '../platform/server/asyncStorage';
+import injectAPI from '@actual-app/api/injected';
+
+import { createTestBudget } from '../mocks/budget';
import { captureException, captureBreadcrumb } from '../platform/exceptions';
-import * as prefs from './prefs';
+import asyncStorage from '../platform/server/asyncStorage';
import fs from '../platform/server/fs';
-import * as sqlite from '../platform/server/sqlite';
import logger from '../platform/server/log';
-import Platform from './platform';
-import * as db from './db';
-import * as sheet from './sheet';
-import { withUndo, clearUndo, undo, redo } from './undo';
-import { updateVersion } from './update';
-import { Condition, Action, rankRules } from './accounts/rules';
-import * as rules from './accounts/transaction-rules';
-import * as mappings from './db/mappings';
-import { batchUpdateTransactions } from './accounts/transactions';
+import * as sqlite from '../platform/server/sqlite';
+import { fromPlaidAccountType } from '../shared/accounts';
+import * as monthUtils from '../shared/months';
+import q, { Query } from '../shared/query';
import { FIELD_TYPES as ruleFieldTypes } from '../shared/rules';
+import { amountToInteger, stringToInteger } from '../shared/util';
+import { exportToCSV, exportQueryToCSV } from './accounts/export-to-csv';
+import * as link from './accounts/link';
+import { parseFile } from './accounts/parse-file';
+import { getStartingBalancePayee } from './accounts/payees';
+import { Condition, Action, rankRules } from './accounts/rules';
+import * as bankSync from './accounts/sync';
+import * as rules from './accounts/transaction-rules';
+import { batchUpdateTransactions } from './accounts/transactions';
+import installAPI from './api';
+import { runQuery as aqlQuery } from './aql';
import {
getAvailableBackups,
loadBackup,
@@ -22,14 +29,9 @@ import {
startBackupService,
stopBackupService
} from './backups';
-import { amountToInteger, stringToInteger } from '../shared/util';
-import * as monthUtils from '../shared/months';
-import { fromPlaidAccountType } from '../shared/accounts';
+import budgetApp from './budget/app';
import * as budget from './budget/base';
-import * as bankSync from './accounts/sync';
-import * as link from './accounts/link';
-import { uniqueFileName, idFromFileName } from './util/budget-name';
-import { mutator, runHandler } from './mutators';
+import * as cloudStorage from './cloud-storage';
import {
getClock,
setClock,
@@ -40,6 +42,19 @@ import {
Timestamp,
merkle
} from './crdt';
+import * as db from './db';
+import * as mappings from './db/mappings';
+import encryption from './encryption';
+import { APIError, TransactionError, PostError, RuleError } from './errors';
+import app from './main-app';
+import { mutator, runHandler } from './mutators';
+import notesApp from './notes/app';
+import Platform from './platform';
+import { get, post } from './post';
+import * as prefs from './prefs';
+import schedulesApp from './schedules/app';
+import { getServer, setServer } from './server-config';
+import * as sheet from './sheet';
import {
initialFullSync,
fullSync,
@@ -52,33 +67,17 @@ import {
repairSync
} from './sync';
import * as syncMigrations from './sync/migrate';
-import { getStartingBalancePayee } from './accounts/payees';
-import { parseFile } from './accounts/parse-file';
-import { exportToCSV, exportQueryToCSV } from './accounts/export-to-csv';
-import { getServer, setServer } from './server-config';
-import installAPI from './api';
-import injectAPI from '@actual-app/api/injected';
-import * as cloudStorage from './cloud-storage';
-import encryption from './encryption';
-import * as tracking from './tracking/events';
-import { get, post } from './post';
-import { APIError, TransactionError, PostError, RuleError } from './errors';
-import { createTestBudget } from '../mocks/budget';
-import { runQuery as aqlQuery } from './aql/schema/run-query';
-import { Query } from '../shared/query';
-import q from '../shared/query';
-import app from './main-app';
-
-// Apps
-import schedulesApp from './schedules/app';
-import budgetApp from './budget/app';
-import notesApp from './notes/app';
import toolsApp from './tools/app';
+import * as tracking from './tracking/events';
+import { withUndo, clearUndo, undo, redo } from './undo';
+import { updateVersion } from './update';
+import { uniqueFileName, idFromFileName } from './util/budget-name';
const YNAB4 = require('@actual-app/import-ynab4/importer');
const YNAB5 = require('@actual-app/import-ynab5/importer');
-const uuid = require('../platform/uuid');
+
const connection = require('../platform/server/connection');
+const uuid = require('../platform/uuid');
const { resolveName, unresolveName } = require('./spreadsheet/util');
const SyncPb = require('./sync/proto/sync_pb');
diff --git a/packages/loot-core/src/server/main.test.js b/packages/loot-core/src/server/main.test.js
index 06ca0ab..8b2a34b 100644
--- a/packages/loot-core/src/server/main.test.js
+++ b/packages/loot-core/src/server/main.test.js
@@ -1,24 +1,24 @@
import { expectSnapshotWithDiffer } from '../mocks/util';
-import * as prefs from './prefs';
-import * as db from './db';
-import * as budget from './budget/base';
import * as monthUtils from '../shared/months';
+import * as budgetActions from './budget/actions';
+import * as budget from './budget/base';
import { getClock, deserializeClock } from './crdt';
+import * as db from './db';
import {
runHandler,
runMutator,
disableGlobalMutations,
enableGlobalMutations
} from './mutators';
-import * as budgetActions from './budget/actions';
+import * as prefs from './prefs';
jest.mock('./post');
+const connection = require('../platform/server/connection');
+const fs = require('../platform/server/fs');
const backend = require('./main');
const { post } = require('./post');
const handlers = backend.handlers;
const sheet = require('./sheet');
-const fs = require('../platform/server/fs');
-const connection = require('../platform/server/connection');
beforeEach(async () => {
await global.emptyDatabase()();
diff --git a/packages/loot-core/src/server/migrate/cli.js b/packages/loot-core/src/server/migrate/cli.js
index a8a9a72..2ca3f98 100755
--- a/packages/loot-core/src/server/migrate/cli.js
+++ b/packages/loot-core/src/server/migrate/cli.js
@@ -1,6 +1,5 @@
#!/usr/bin/env node --trace-warnings
import * as sqlite from '../../platform/server/sqlite';
-
import {
getMigrationsDir,
withMigrationsDir,
@@ -10,6 +9,7 @@ import {
getPending,
migrate
} from './migrations';
+
const fs = require('fs');
const path = require('path');
diff --git a/packages/loot-core/src/server/migrate/migrations.js b/packages/loot-core/src/server/migrate/migrations.js
index fe2e808..3bf278e 100644
--- a/packages/loot-core/src/server/migrate/migrations.js
+++ b/packages/loot-core/src/server/migrate/migrations.js
@@ -1,10 +1,9 @@
-import fs from '../../platform/server/fs';
-import * as sqlite from '../../platform/server/sqlite';
-
// We have to bundle in JS migrations manually to avoid having to `eval`
// them which doesn't play well with CSP. There isn't great, and eventually
// we can remove this migration.
import m1632571489012 from '../../../migrations/1632571489012_remove_cache.js';
+import fs from '../../platform/server/fs';
+import * as sqlite from '../../platform/server/sqlite';
const uuid = require('../../platform/uuid');
diff --git a/packages/loot-core/src/server/migrate/migrations.test.js b/packages/loot-core/src/server/migrate/migrations.test.js
index 64279b0..a068eb0 100644
--- a/packages/loot-core/src/server/migrate/migrations.test.js
+++ b/packages/loot-core/src/server/migrate/migrations.test.js
@@ -1,3 +1,4 @@
+import * as db from '../db';
import {
migrate,
withMigrationsDir,
@@ -5,7 +6,6 @@ import {
getMigrationList,
getPending
} from './migrations';
-import * as db from '../db';
beforeEach(global.emptyDatabase(true));
diff --git a/packages/loot-core/src/server/mutators.js b/packages/loot-core/src/server/mutators.js
index f3d29ff..2e96478 100644
--- a/packages/loot-core/src/server/mutators.js
+++ b/packages/loot-core/src/server/mutators.js
@@ -1,5 +1,5 @@
-import { sequential } from '../shared/async';
import { captureException, captureBreadcrumb } from '../platform/exceptions';
+import { sequential } from '../shared/async';
let runningMethods = new Set();
diff --git a/packages/loot-core/src/server/post.js b/packages/loot-core/src/server/post.js
index 75fa24c..5f711df 100644
--- a/packages/loot-core/src/server/post.js
+++ b/packages/loot-core/src/server/post.js
@@ -1,6 +1,7 @@
import Platform from './platform';
-const { PostError } = require('./errors');
+
const { fetch } = require('../platform/server/fetch');
+const { PostError } = require('./errors');
function throwIfNot200(res, text) {
if (res.status !== 200) {
diff --git a/packages/loot-core/src/server/prefs.js b/packages/loot-core/src/server/prefs.js
index fb7df91..6e91dba 100644
--- a/packages/loot-core/src/server/prefs.js
+++ b/packages/loot-core/src/server/prefs.js
@@ -1,5 +1,6 @@
-import { sendMessages } from './sync';
import { Timestamp } from './crdt';
+import { sendMessages } from './sync';
+
const fs = require('../platform/server/fs');
let prefs = null;
diff --git a/packages/loot-core/src/server/schedules/app.js b/packages/loot-core/src/server/schedules/app.js
index 062490e..9f813ec 100644
--- a/packages/loot-core/src/server/schedules/app.js
+++ b/packages/loot-core/src/server/schedules/app.js
@@ -1,19 +1,9 @@
-import deepEqual from 'deep-equal';
import * as d from 'date-fns';
-import { createApp } from '../app';
-import * as db from '../db';
-import * as prefs from '../prefs';
-import { toDateRepr } from '../models';
-import { runQuery as aqlQuery } from '../aql/schema/run-query';
+import deepEqual from 'deep-equal';
+
+import { captureBreadcrumb } from '../../platform/exceptions';
import { dayFromDate, currentDay, parseDate } from '../../shared/months';
import q from '../../shared/query';
-import {
- insertRule,
- updateRule,
- getRules,
- ruleModel
-} from '../accounts/transaction-rules';
-import { Rule, Condition } from '../accounts/rules';
import {
extractScheduleConds,
recurConfigToRSchedule,
@@ -21,12 +11,23 @@ import {
getStatus,
getScheduledAmount
} from '../../shared/schedules';
+import { Rule, Condition } from '../accounts/rules';
+import { addTransactions } from '../accounts/sync';
+import {
+ insertRule,
+ updateRule,
+ getRules,
+ ruleModel
+} from '../accounts/transaction-rules';
+import { createApp } from '../app';
+import { runQuery as aqlQuery } from '../aql';
+import * as db from '../db';
+import { toDateRepr } from '../models';
import { mutator, runMutator } from '../mutators';
+import * as prefs from '../prefs';
+import { addSyncListener, batchMessages } from '../sync';
import { undoable } from '../undo';
import { Schedule as RSchedule } from '../util/rschedule';
-import { addSyncListener, batchMessages } from '../sync';
-import { captureBreadcrumb } from '../../platform/exceptions';
-import { addTransactions } from '../accounts/sync';
import { findSchedules } from './find-schedules';
const connection = require('../../platform/server/connection');
diff --git a/packages/loot-core/src/server/schedules/app.test.js b/packages/loot-core/src/server/schedules/app.test.js
index 916244c..b8864e7 100644
--- a/packages/loot-core/src/server/schedules/app.test.js
+++ b/packages/loot-core/src/server/schedules/app.test.js
@@ -1,6 +1,8 @@
-import { runQuery as aqlQuery } from '../aql/schema/run-query';
+import MockDate from 'mockdate';
+
import q from '../../shared/query';
import { loadRules, updateRule } from '../accounts/transaction-rules';
+import { runQuery as aqlQuery } from '../aql';
import { loadMappings } from '../db/mappings';
import {
updateConditions,
@@ -10,7 +12,6 @@ import {
deleteSchedule,
setNextDate
} from './app';
-import MockDate from 'mockdate';
beforeEach(async () => {
await global.emptyDatabase()();
diff --git a/packages/loot-core/src/server/schedules/find-schedules.js b/packages/loot-core/src/server/schedules/find-schedules.js
index 6432f0b..8ac2580 100644
--- a/packages/loot-core/src/server/schedules/find-schedules.js
+++ b/packages/loot-core/src/server/schedules/find-schedules.js
@@ -1,14 +1,16 @@
import * as d from 'date-fns';
-import * as db from '../db';
-import { Schedule as RSchedule } from '../util/rschedule';
-import { groupBy } from '../../shared/util';
-import { fromDateRepr } from '../models';
-import { runQuery as aqlQuery } from '../aql/schema/run-query';
+
+import { dayFromDate, parseDate } from '../../shared/months';
import q from '../../shared/query';
import { getApproxNumberThreshold } from '../../shared/rules';
import { recurConfigToRSchedule } from '../../shared/schedules';
-import { dayFromDate, parseDate } from '../../shared/months';
+import { groupBy } from '../../shared/util';
import { conditionsToAQL } from '../accounts/transaction-rules';
+import { runQuery as aqlQuery } from '../aql';
+import * as db from '../db';
+import { fromDateRepr } from '../models';
+import { Schedule as RSchedule } from '../util/rschedule';
+
const uuid = require('../../platform/uuid');
function takeDates(config) {
diff --git a/packages/loot-core/src/server/sheet.js b/packages/loot-core/src/server/sheet.js
index 5df2ec4..bc16219 100644
--- a/packages/loot-core/src/server/sheet.js
+++ b/packages/loot-core/src/server/sheet.js
@@ -1,9 +1,10 @@
-import Spreadsheet from './spreadsheet/spreadsheet';
-import * as prefs from './prefs';
import { captureBreadcrumb } from '../platform/exceptions';
import * as sqlite from '../platform/server/sqlite';
import { sheetForMonth } from '../shared/months';
import Platform from './platform';
+import * as prefs from './prefs';
+import Spreadsheet from './spreadsheet/spreadsheet';
+
const { resolveName } = require('./spreadsheet/util');
let globalSheet, globalOnChange;
diff --git a/packages/loot-core/src/server/sheet.test.js b/packages/loot-core/src/server/sheet.test.js
index 180f562..4f38959 100644
--- a/packages/loot-core/src/server/sheet.test.js
+++ b/packages/loot-core/src/server/sheet.test.js
@@ -1,6 +1,6 @@
+import { generateTransaction } from '../mocks';
import * as db from './db';
import * as sheet from './sheet';
-import { generateTransaction } from '../mocks';
beforeEach(global.emptyDatabase());
diff --git a/packages/loot-core/src/server/spreadsheet/interpreter.js b/packages/loot-core/src/server/spreadsheet/interpreter.js
index d659995..38aecd7 100644
--- a/packages/loot-core/src/server/spreadsheet/interpreter.js
+++ b/packages/loot-core/src/server/spreadsheet/interpreter.js
@@ -1,4 +1,5 @@
const escodegen = require('@jlongster/escodegen');
+
const globals = require('./globals');
// Unfortunately we need to use eval to bypass babel's transform of
diff --git a/packages/loot-core/src/server/spreadsheet/new/compiler.js b/packages/loot-core/src/server/spreadsheet/new/compiler.js
index f5cbbe9..7f1c363 100644
--- a/packages/loot-core/src/server/spreadsheet/new/compiler.js
+++ b/packages/loot-core/src/server/spreadsheet/new/compiler.js
@@ -1,6 +1,5 @@
-import parse from './parser';
+import getSqlFields from './get-sql-fields';
import * as nodes from './nodes';
-import generateSql from './sqlgen';
import {
MOV,
CALL,
@@ -14,7 +13,8 @@ import {
JUMPT,
LABEL
} from './ops';
-import getSqlFields from './get-sql-fields';
+import parse from './parser';
+import generateSql from './sqlgen';
class Compiler {
constructor() {
diff --git a/packages/loot-core/src/server/spreadsheet/new/vm.test.js b/packages/loot-core/src/server/spreadsheet/new/vm.test.js
index 6c3a726..bfebe10 100644
--- a/packages/loot-core/src/server/spreadsheet/new/vm.test.js
+++ b/packages/loot-core/src/server/spreadsheet/new/vm.test.js
@@ -1,4 +1,5 @@
import VM from './vm';
+
const { unresolveName } = require('../util');
const db = {
diff --git a/packages/loot-core/src/server/spreadsheet/spreadsheet.js b/packages/loot-core/src/server/spreadsheet/spreadsheet.js
index 49de21d..459be7b 100644
--- a/packages/loot-core/src/server/spreadsheet/spreadsheet.js
+++ b/packages/loot-core/src/server/spreadsheet/spreadsheet.js
@@ -1,7 +1,6 @@
import mitt from 'mitt';
-import { schema, schemaConfig } from '../aql/schema';
-import { compileQuery } from '../aql/compiler';
-import { runCompiledQuery } from '../aql/schema/run-query';
+
+import { compileQuery, runCompiledQuery, schema, schemaConfig } from '../aql';
const Graph = require('./graph-data-structure');
const { unresolveName, resolveName } = require('./util');
diff --git a/packages/loot-core/src/server/spreadsheet/spreadsheet.test.js b/packages/loot-core/src/server/spreadsheet/spreadsheet.test.js
index 76935df..a22b7ca 100644
--- a/packages/loot-core/src/server/spreadsheet/spreadsheet.test.js
+++ b/packages/loot-core/src/server/spreadsheet/spreadsheet.test.js
@@ -1,6 +1,6 @@
-import Spreadsheet from './spreadsheet';
-import * as db from '../db';
import { generateTransaction } from '../../mocks';
+import * as db from '../db';
+import Spreadsheet from './spreadsheet';
beforeEach(global.emptyDatabase());
diff --git a/packages/loot-core/src/server/spreadsheet/tests/data-propagation.js b/packages/loot-core/src/server/spreadsheet/tests/data-propagation.js
index 9d8544f..8268ef7 100644
--- a/packages/loot-core/src/server/spreadsheet/tests/data-propagation.js
+++ b/packages/loot-core/src/server/spreadsheet/tests/data-propagation.js
@@ -1,4 +1,5 @@
const expect = require('expect');
+
const propagate = require('../data-compute/propagate.js');
describe('data propagation', () => {
diff --git a/packages/loot-core/src/server/spreadsheet/usage.js b/packages/loot-core/src/server/spreadsheet/usage.js
index abe6f8c..efedaa4 100644
--- a/packages/loot-core/src/server/spreadsheet/usage.js
+++ b/packages/loot-core/src/server/spreadsheet/usage.js
@@ -1,11 +1,11 @@
-const sqlite = require('sqlite3');
const escodegen = require('escodegen');
+const sqlite = require('sqlite3');
+
+const Spreadsheet = require('./spreadsheet');
const sqlgen = require('./sqlgen');
// Example usage:
-const Spreadsheet = require('./spreadsheet');
-
const db = new sqlite.Database(__dirname + '/../../db.sqlite');
const sheet = new Spreadsheet({
plugins: {
diff --git a/packages/loot-core/src/server/sync/encoder.js b/packages/loot-core/src/server/sync/encoder.js
index 82b9c20..b2db4bf 100644
--- a/packages/loot-core/src/server/sync/encoder.js
+++ b/packages/loot-core/src/server/sync/encoder.js
@@ -1,5 +1,6 @@
import encryption from '../encryption';
import * as prefs from '../prefs';
+
let { SyncError } = require('../errors');
let SyncPb = require('./proto/sync_pb');
diff --git a/packages/loot-core/src/server/sync/index.js b/packages/loot-core/src/server/sync/index.js
index 02248ca..20d59fc 100644
--- a/packages/loot-core/src/server/sync/index.js
+++ b/packages/loot-core/src/server/sync/index.js
@@ -1,16 +1,9 @@
-import { sequential, once } from '../../shared/async';
-import * as prefs from '../prefs';
-import app from '../main-app';
-import asyncStorage from '../../platform/server/asyncStorage';
import { captureException } from '../../platform/exceptions';
+import asyncStorage from '../../platform/server/asyncStorage';
import logger from '../../platform/server/log';
-import { postBinary } from '../post';
-import * as db from '../db';
-import * as sheet from '../sheet';
-import { triggerBudgetChanges, setType as setBudgetType } from '../budget/base';
-import * as undo from '../undo';
-import { runMutator } from '../mutators';
+import { sequential, once } from '../../shared/async';
import { setIn, getIn } from '../../shared/util';
+import { triggerBudgetChanges, setType as setBudgetType } from '../budget/base';
import {
serializeClock,
deserializeClock,
@@ -18,12 +11,19 @@ import {
Timestamp,
merkle
} from '../crdt';
-import * as encoder from './encoder';
+import * as db from '../db';
+import app from '../main-app';
+import { runMutator } from '../mutators';
+import { postBinary } from '../post';
+import * as prefs from '../prefs';
import { getServer } from '../server-config';
+import * as sheet from '../sheet';
+import * as undo from '../undo';
+import * as encoder from './encoder';
import { rebuildMerkleHash } from './repair';
-const { PostError, SyncError } = require('../errors');
const connection = require('../../platform/server/connection');
+const { PostError, SyncError } = require('../errors');
export { default as makeTestMessage } from './make-test-message';
export { default as resetSync } from './reset';
diff --git a/packages/loot-core/src/server/sync/make-test-message.js b/packages/loot-core/src/server/sync/make-test-message.js
index ca02aaf..88ebf1c 100644
--- a/packages/loot-core/src/server/sync/make-test-message.js
+++ b/packages/loot-core/src/server/sync/make-test-message.js
@@ -1,4 +1,5 @@
import encryption from '../encryption';
+
let SyncPb = require('./proto/sync_pb');
async function randomString() {
diff --git a/packages/loot-core/src/server/sync/migrate.js b/packages/loot-core/src/server/sync/migrate.js
index 40fcaa3..20f055c 100644
--- a/packages/loot-core/src/server/sync/migrate.js
+++ b/packages/loot-core/src/server/sync/migrate.js
@@ -1,6 +1,7 @@
-import { addSyncListener, applyMessages } from './index';
import { Timestamp } from '../crdt';
+import { addSyncListener, applyMessages } from './index';
+
function migrateParentIds(oldValues, newValues) {
newValues.forEach((items, table) => {
if (table === 'transactions') {
diff --git a/packages/loot-core/src/server/sync/migrate.test.js b/packages/loot-core/src/server/sync/migrate.test.js
index 5286c59..806b50c 100644
--- a/packages/loot-core/src/server/sync/migrate.test.js
+++ b/packages/loot-core/src/server/sync/migrate.test.js
@@ -1,11 +1,12 @@
import fc from 'fast-check';
+
+import arbs from '../../mocks/arbitrary-schema';
+import { execTracer } from '../../shared/test-helpers';
+import { convertInputType, schema, schemaConfig } from '../aql';
import * as db from '../db';
import { listen, unlisten } from './migrate';
+
import { addSyncListener, sendMessages } from './index';
-import { execTracer } from '../../shared/test-helpers';
-import { schema, schemaConfig } from '../aql/schema';
-import arbs from '../../mocks/arbitrary-schema';
-import { convertInputType } from '../aql/schema-helpers';
beforeEach(() => {
listen();
diff --git a/packages/loot-core/src/server/sync/repair.js b/packages/loot-core/src/server/sync/repair.js
index 9ebedd8..6a86aba 100644
--- a/packages/loot-core/src/server/sync/repair.js
+++ b/packages/loot-core/src/server/sync/repair.js
@@ -1,5 +1,5 @@
-import * as db from '../db';
import { serializeClock, getClock, Timestamp, merkle } from '../crdt';
+import * as db from '../db';
export function rebuildMerkleHash() {
let rows = db.runQuery('SELECT timestamp FROM messages_crdt', [], true);
diff --git a/packages/loot-core/src/server/sync/reset.js b/packages/loot-core/src/server/sync/reset.js
index fda144c..266c0c1 100644
--- a/packages/loot-core/src/server/sync/reset.js
+++ b/packages/loot-core/src/server/sync/reset.js
@@ -1,9 +1,10 @@
+import { captureException } from '../../platform/exceptions';
+import asyncStorage from '../../platform/server/asyncStorage';
import * as cloudStorage from '../cloud-storage';
import * as db from '../db';
-import * as prefs from '../prefs';
-import asyncStorage from '../../platform/server/asyncStorage';
-import { captureException } from '../../platform/exceptions';
import { runMutator } from '../mutators';
+import * as prefs from '../prefs';
+
const connection = require('../../platform/server/connection');
export default async function resetSync(keyState) {
diff --git a/packages/loot-core/src/server/sync/sync.property.test.js b/packages/loot-core/src/server/sync/sync.property.test.js
index 0c798c8..6ccfe63 100644
--- a/packages/loot-core/src/server/sync/sync.property.test.js
+++ b/packages/loot-core/src/server/sync/sync.property.test.js
@@ -1,9 +1,11 @@
-import * as prefs from '../prefs';
-import * as db from '../db';
-import * as sheet from '../sheet';
-import * as sync from './index';
import { merkle, getClock, Timestamp } from '../crdt';
+import * as db from '../db';
+import * as prefs from '../prefs';
+import * as sheet from '../sheet';
import * as encoder from './encoder';
+
+import * as sync from './index';
+
const jsc = require('jsverify');
const uuidGenerator = jsc.integer(97, 122).smap(
x => String.fromCharCode(x),
diff --git a/packages/loot-core/src/server/sync/sync.test.js b/packages/loot-core/src/server/sync/sync.test.js
index cea7d05..b7efcb1 100644
--- a/packages/loot-core/src/server/sync/sync.test.js
+++ b/packages/loot-core/src/server/sync/sync.test.js
@@ -1,10 +1,12 @@
-import * as prefs from '../prefs';
-import * as db from '../db';
-import * as sheet from '../sheet';
import { getClock, Timestamp } from '../crdt';
+import * as db from '../db';
+import * as prefs from '../prefs';
+import * as sheet from '../sheet';
import { resolveName } from '../spreadsheet/util';
-import { setSyncingMode, sendMessages, applyMessages, fullSync } from './index';
import * as encoder from './encoder';
+
+import { setSyncingMode, sendMessages, applyMessages, fullSync } from './index';
+
const mockSyncServer = require('../tests/mockSyncServer');
beforeEach(() => {
diff --git a/packages/loot-core/src/server/tests/mockSyncServer.js b/packages/loot-core/src/server/tests/mockSyncServer.js
index ceb12d7..1894ead 100644
--- a/packages/loot-core/src/server/tests/mockSyncServer.js
+++ b/packages/loot-core/src/server/tests/mockSyncServer.js
@@ -1,7 +1,9 @@
import dateFns from 'date-fns';
+
import { makeClock, Timestamp, merkle } from '../crdt';
-const defaultMockData = require('./mockData').basic;
+
const SyncPb = require('../sync/proto/sync_pb');
+const defaultMockData = require('./mockData').basic;
const handlers = {};
let currentMockData = defaultMockData;
diff --git a/packages/loot-core/src/server/tools/app.js b/packages/loot-core/src/server/tools/app.js
index 45d48c0..1a533c0 100644
--- a/packages/loot-core/src/server/tools/app.js
+++ b/packages/loot-core/src/server/tools/app.js
@@ -1,7 +1,7 @@
-import { runMutator } from '../mutators';
+import { batchUpdateTransactions } from '../accounts/transactions';
import { createApp } from '../app';
import * as db from '../db';
-import { batchUpdateTransactions } from '../accounts/transactions';
+import { runMutator } from '../mutators';
let app = createApp();
diff --git a/packages/loot-core/src/server/undo.js b/packages/loot-core/src/server/undo.js
index bc96741..fde8373 100644
--- a/packages/loot-core/src/server/undo.js
+++ b/packages/loot-core/src/server/undo.js
@@ -1,7 +1,8 @@
-import { sendMessages } from './sync';
import { getIn } from '../shared/util';
import { Timestamp } from './crdt';
import { withMutatorContext, getMutatorContext } from './mutators';
+import { sendMessages } from './sync';
+
const connection = require('../platform/server/connection');
// A marker always sits as the first entry to simplify logic
diff --git a/packages/loot-core/src/server/update.js b/packages/loot-core/src/server/update.js
index f108a1a..c8e2f6a 100644
--- a/packages/loot-core/src/server/update.js
+++ b/packages/loot-core/src/server/update.js
@@ -1,8 +1,8 @@
import md5 from 'md5';
-import * as migrations from './migrate/migrations';
+
+import { schema, schemaConfig, makeViews } from './aql';
import * as db from './db';
-import { schema, schemaConfig } from './aql/schema';
-import { makeViews } from './aql/views';
+import * as migrations from './migrate/migrations';
// Managing the init/update process
diff --git a/packages/loot-core/src/server/util/budget-name.js b/packages/loot-core/src/server/util/budget-name.js
index 6163cb1..811904b 100644
--- a/packages/loot-core/src/server/util/budget-name.js
+++ b/packages/loot-core/src/server/util/budget-name.js
@@ -1,4 +1,5 @@
import fs from '../../platform/server/fs';
+
const uuid = require('../../platform/uuid');
export async function uniqueFileName(existingFiles) {
diff --git a/packages/loot-core/src/shared/schedules.test.js b/packages/loot-core/src/shared/schedules.test.js
index 880899d..a3733b4 100644
--- a/packages/loot-core/src/shared/schedules.test.js
+++ b/packages/loot-core/src/shared/schedules.test.js
@@ -1,6 +1,7 @@
-import { getRecurringDescription } from './schedules';
import MockDate from 'mockdate';
+import { getRecurringDescription } from './schedules';
+
describe('recurring date description', () => {
beforeEach(() => {
MockDate.set(new Date(2021, 4, 14));
diff --git a/packages/loot-core/src/shared/transactions.js b/packages/loot-core/src/shared/transactions.js
index b5bf3fd..97559e9 100644
--- a/packages/loot-core/src/shared/transactions.js
+++ b/packages/loot-core/src/shared/transactions.js
@@ -1,4 +1,5 @@
import { last, diffItems, applyChanges } from './util';
+
const uuid = require('../platform/uuid');
// The amount might be null when adding a new transaction
diff --git a/packages/loot-core/src/shared/transactions.test.js b/packages/loot-core/src/shared/transactions.test.js
index b95471e..743e553 100644
--- a/packages/loot-core/src/shared/transactions.test.js
+++ b/packages/loot-core/src/shared/transactions.test.js
@@ -5,6 +5,7 @@ import {
addSplitTransaction,
makeChild
} from './transactions';
+
const uuid = require('../platform/uuid');
// const data = {
diff --git a/packages/loot-design/package.json b/packages/loot-design/package.json
index 1b54ea5..4d9a147 100644
--- a/packages/loot-design/package.json
+++ b/packages/loot-design/package.json
@@ -12,6 +12,8 @@
"chroma-js": "^1.3.3",
"date-fns": "2.0.0-alpha.27",
"downshift": "1.31.16",
+ "eslint": "5.6.0",
+ "eslint-plugin-prettier": "^3.1.4",
"fast-glob": "^2.2.2",
"formik": "^0.11.10",
"glamor": "^2.20.40",
@@ -48,7 +50,8 @@
"start:mobile": "IS_REACT_NATIVE=1 react-scripts start",
"test": "npm-run-all -cp 'test:*'",
"test:web": "jest -c jest.config.js",
- "test:react-native": "jest -c jest.rn.config.js"
+ "test:react-native": "jest -c jest.rn.config.js",
+ "lint": "eslint src"
},
"homepage": "./",
"manifest": "manifest.json",
@@ -61,8 +64,5 @@
},
"browserslist": [
"electron 3.0"
- ],
- "eslintConfig": {
- "extends": "react-app"
- }
+ ]
}
diff --git a/packages/loot-design/src/components/AccountAutocomplete.js b/packages/loot-design/src/components/AccountAutocomplete.js
index 2eccf66..cc60052 100644
--- a/packages/loot-design/src/components/AccountAutocomplete.js
+++ b/packages/loot-design/src/components/AccountAutocomplete.js
@@ -1,8 +1,10 @@
import React from 'react';
+
import { useCachedAccounts } from 'loot-core/src/client/data-hooks/accounts';
+
+import { colors } from '../style';
import Autocomplete from './Autocomplete';
import { View } from './common';
-import { colors } from '../style';
export function AccountList({
items,
diff --git a/packages/loot-design/src/components/Autocomplete.js b/packages/loot-design/src/components/Autocomplete.js
index ccb002f..52c1759 100644
--- a/packages/loot-design/src/components/Autocomplete.js
+++ b/packages/loot-design/src/components/Autocomplete.js
@@ -1,7 +1,9 @@
import React, { useState, useRef, useEffect } from 'react';
+
import lively from '@jlongster/lively';
import Downshift from 'downshift';
import { css } from 'glamor';
+
import { colors } from '../style';
import Remove from '../svg/v2/Remove';
import { View, Input, Tooltip, Button } from './common';
diff --git a/packages/loot-design/src/components/Autocomplete.usage.js b/packages/loot-design/src/components/Autocomplete.usage.js
index 987a68e..2820f42 100644
--- a/packages/loot-design/src/components/Autocomplete.usage.js
+++ b/packages/loot-design/src/components/Autocomplete.usage.js
@@ -1,7 +1,9 @@
import React from 'react';
-import Autocomplete, { MultiAutocomplete } from './Autocomplete';
+
import Component from '@reactions/component';
+
import { Section } from '../guide/components';
+import Autocomplete, { MultiAutocomplete } from './Autocomplete';
let items = [
{ id: 'one', name: 'James' },
diff --git a/packages/loot-design/src/components/CategorySelect.js b/packages/loot-design/src/components/CategorySelect.js
index f94dd23..2218079 100644
--- a/packages/loot-design/src/components/CategorySelect.js
+++ b/packages/loot-design/src/components/CategorySelect.js
@@ -1,8 +1,9 @@
import React, { useMemo } from 'react';
-import { View, Text, Select } from './common';
-import Autocomplete, { defaultFilterSuggestion } from './Autocomplete';
+
import { colors } from '../style';
import Split from '../svg/split';
+import Autocomplete, { defaultFilterSuggestion } from './Autocomplete';
+import { View, Text, Select } from './common';
export const NativeCategorySelect = React.forwardRef(
({ categoryGroups, emptyLabel, ...nativeProps }, ref) => {
diff --git a/packages/loot-design/src/components/DateSelect.js b/packages/loot-design/src/components/DateSelect.js
index db9b998..dbb766b 100644
--- a/packages/loot-design/src/components/DateSelect.js
+++ b/packages/loot-design/src/components/DateSelect.js
@@ -6,11 +6,11 @@ import React, {
useImperativeHandle,
useMemo
} from 'react';
+
import * as d from 'date-fns';
import Pikaday from 'pikaday';
+
import 'pikaday/css/pikaday.css';
-import { colors } from '../style';
-import { View, Input, Tooltip } from './common';
import {
getDayMonthFormat,
getDayMonthRegex,
@@ -18,6 +18,8 @@ import {
getShortYearRegex
} from 'loot-core/src/shared/months';
+import { colors } from '../style';
+import { View, Input, Tooltip } from './common';
import DateSelectLeft from './DateSelect.left.png';
import DateSelectRight from './DateSelect.right.png';
diff --git a/packages/loot-design/src/components/DateSelect.usage.js b/packages/loot-design/src/components/DateSelect.usage.js
index c583ae9..38019c1 100644
--- a/packages/loot-design/src/components/DateSelect.usage.js
+++ b/packages/loot-design/src/components/DateSelect.usage.js
@@ -1,6 +1,7 @@
import React from 'react';
-import DateSelect from './DateSelect';
+
import { Section } from '../guide/components';
+import DateSelect from './DateSelect';
export default () => (
When you've located your data,{' '} - compress it into a zip file. On macOS, right-click - the folder and select "Compress". On Windows, right-click and - select "Send to > Compressed (zipped) folder". Upload the zipped - folder for importing. + compress it into a zip file. On macOS, + right-click the folder and select "Compress". On Windows, + right-click and select "Send to > Compressed (zipped) folder". + Upload the zipped folder for importing.