Skip to content

Commit

Permalink
Sort import in alphabetical order (actualbudget#238)
Browse files Browse the repository at this point in the history
* style: enforce sorting of imports

* style: alphabetize imports

* style: merge duplicated imports
  • Loading branch information
TomAFrench authored Sep 2, 2022
1 parent dc53a74 commit 9c0df36
Show file tree
Hide file tree
Showing 194 changed files with 721 additions and 718 deletions.
4 changes: 4 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ module.exports = {
'import/order': [
'error',
{
alphabetize: {
caseInsensitive: true,
order: 'asc'
},
groups: [
'builtin', // Built-in types are first
'external',
Expand Down
6 changes: 3 additions & 3 deletions packages/desktop-client/src/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ import {
import { styles, hasHiddenScrollbars } from 'loot-design/src/style';

import installPolyfills from '../polyfills';
import AppBackground from './AppBackground';
import FatalError from './FatalError';
import ManagementApp from './manager/ManagementApp';
import FinancesApp from './FinancesApp';
import AppBackground from './AppBackground';
import UpdateNotification from './UpdateNotification';
import ManagementApp from './manager/ManagementApp';
import MobileWebMessage from './MobileWebMessage';
import UpdateNotification from './UpdateNotification';

class App extends React.Component {
state = {
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop-client/src/components/AppBackground.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import React from 'react';
import { css } from 'glamor';

import { View, Block } from 'loot-design/src/components/common';
import AnimatedLoading from 'loot-design/src/svg/v1/AnimatedLoading';
import { colors } from 'loot-design/src/style';
import AnimatedLoading from 'loot-design/src/svg/v1/AnimatedLoading';

import Background from './Background';

Expand Down
2 changes: 1 addition & 1 deletion packages/desktop-client/src/components/Debugger.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ 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 {
View,
Button,
Expand Down
35 changes: 17 additions & 18 deletions packages/desktop-client/src/components/FinancesApp.js
Original file line number Diff line number Diff line change
@@ -1,42 +1,41 @@
import React, { useMemo } from 'react';
import { Router, Route, Redirect, Switch, useLocation } from 'react-router-dom';
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 { 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 } from '../util/location-state';
import { makeLocationState } from '../util/location-state';
import { PageTypeProvider } from './Page';
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 FloatableSidebar, { SidebarProvider } from './FloatableSidebar';
import GlobalKeys from './GlobalKeys';
import Modals from './Modals';
import Notifications from './Notifications';
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 DiscoverSchedules from './schedules/DiscoverSchedules';
import PostsOfflineNotification from './schedules/PostsOfflineNotification';
import FixSplitsTool from './tools/FixSplitsTool';
import Settings from './Settings';
import Modals from './Modals';
import Notifications from './Notifications';
import GlobalKeys from './GlobalKeys';
import Titlebar, { TitlebarProvider } from './Titlebar';
import FixSplitsTool from './tools/FixSplitsTool';
// import Debugger from './Debugger';

function URLBar() {
Expand Down
22 changes: 11 additions & 11 deletions packages/desktop-client/src/components/Modals.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,30 @@ import React from 'react';
import { connect } from 'react-redux';
import { Route, Switch } from 'react-router-dom';

import { bindActionCreators } from 'redux';
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 SelectLinkedAccounts from 'loot-design/src/components/modals/SelectLinkedAccounts';

import ConfirmCategoryDelete from './modals/ConfirmCategoryDelete';
import CreateAccount from './modals/CreateAccount';
import ManagePayeesWithData from './payees/ManagePayeesWithData';
import ManageRules from './modals/ManageRules';
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 ConfirmCategoryDelete from './modals/ConfirmCategoryDelete';
import WelcomeScreen from './modals/WelcomeScreen';
import CreateEncryptionKey from './modals/CreateEncryptionKey';
import FixEncryptionKey from './modals/FixEncryptionKey';
import ManagePayeesWithData from './payees/ManagePayeesWithData';

function Modals({
history,
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop-client/src/components/Notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,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 (
Expand Down
8 changes: 4 additions & 4 deletions packages/desktop-client/src/components/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ 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,
Button,
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';

Expand Down
6 changes: 3 additions & 3 deletions packages/desktop-client/src/components/SidebarWithData.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ 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,
InitialFocus,
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);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +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 (
Expand Down
14 changes: 7 additions & 7 deletions packages/desktop-client/src/components/Titlebar.js
Original file line number Diff line number Diff line change
@@ -1,12 +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,
Expand All @@ -17,16 +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 ArrowButtonRight1 from 'loot-design/src/svg/v2/ArrowButtonRight1';
import NavigationMenu from 'loot-design/src/svg/v2/NavigationMenu';

import { MonthCountSelector } from './budget/MonthCountSelector';
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();

Expand Down
12 changes: 6 additions & 6 deletions packages/desktop-client/src/components/Tutorial.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ import { bindActionCreators } from '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 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 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';

function generatePath(innerRect, outerRect) {
const i = innerRect;
Expand Down
64 changes: 32 additions & 32 deletions packages/desktop-client/src/components/accounts/Account.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,27 @@ import React, { useState, useEffect, useRef, useMemo } from 'react';
import { useSelector, useDispatch } from 'react-redux';
import { Redirect, useParams, useHistory, useLocation } from 'react-router-dom';

import { bindActionCreators } from 'redux';
import { debounce } from 'debounce';
import { bindActionCreators } from 'redux';

import { send, listen } from 'loot-core/src/platform/client/fetch';
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,
Expand All @@ -18,46 +34,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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ 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';

Expand Down
Loading

0 comments on commit 9c0df36

Please sign in to comment.