Skip to content

Commit

Permalink
Fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
joel-jeremy committed Jan 8, 2025
1 parent 4b1fa49 commit fb5f58e
Show file tree
Hide file tree
Showing 24 changed files with 85 additions and 107 deletions.
2 changes: 1 addition & 1 deletion packages/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type {
import type { InitConfig } from 'loot-core/server/main';

// @ts-ignore: bundle not available until we build it
// eslint-disable-next-line import/extensions, import/no-unresolved
// eslint-disable-next-line import/extensions
import * as bundle from './app/bundle.api.js';

Check failure on line 12 in packages/api/index.ts

View workflow job for this annotation

GitHub Actions / lint

Unable to resolve path to module './app/bundle.api.js'
import * as injected from './injected';
import { validateNodeVersion } from './validateNodeVersion';
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop-client/src/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
sync,
} from 'loot-core/client/actions';
import { setAppState } from 'loot-core/client/app/appSlice';
import { closeBudget, loadBudget } from 'loot-core/client/budgets/budgetsSlice';
import { SpreadsheetProvider } from 'loot-core/client/SpreadsheetProvider';
import * as Platform from 'loot-core/src/client/platform';
import {
Expand All @@ -42,7 +43,6 @@ import { Modals } from './Modals';
import { ResponsiveProvider } from './responsive/ResponsiveProvider';
import { SidebarProvider } from './sidebar/SidebarProvider';
import { UpdateNotification } from './UpdateNotification';
import { closeBudget, loadBudget } from 'loot-core/client/budgets/budgetsSlice';

function AppInner() {
const [budgetId] = useMetadataPref('id');
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop-client/src/components/LoggedInUser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Trans, useTranslation } from 'react-i18next';
import { useLocation } from 'react-router-dom';

import { getUserData, signOut } from 'loot-core/client/actions';
import { closeBudget } from 'loot-core/client/budgets/budgetsSlice';
import { type RemoteFile, type SyncedLocalFile } from 'loot-core/types/file';
import { type TransObjectLiteral } from 'loot-core/types/util';

Expand All @@ -20,7 +21,6 @@ import { Text } from './common/Text';
import { View } from './common/View';
import { PrivacyFilter } from './PrivacyFilter';
import { useMultiuserEnabled, useServerURL } from './ServerContext';
import { closeBudget } from 'loot-core/client/budgets/budgetsSlice';

type LoggedInUserProps = {
hideIfNoServer?: boolean;
Expand Down
12 changes: 8 additions & 4 deletions packages/desktop-client/src/components/manager/BudgetList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@ import React, {
} from 'react';
import { Trans, useTranslation } from 'react-i18next';

import { getUserData, pushModal } from 'loot-core/client/actions';
import {
getUserData,
pushModal,
} from 'loot-core/client/actions';
closeAndDownloadBudget,
closeAndLoadBudget,
createBudget,
downloadBudget,
loadAllFiles,
loadBudget,
} from 'loot-core/client/budgets/budgetsSlice';
import {
isElectron,
isNonProductionEnvironment,
Expand Down Expand Up @@ -47,7 +52,6 @@ import { Tooltip } from '../common/Tooltip';
import { View } from '../common/View';
import { useResponsive } from '../responsive/ResponsiveProvider';
import { useMultiuserEnabled } from '../ServerContext';
import { closeAndDownloadBudget, closeAndLoadBudget, createBudget, downloadBudget, loadAllFiles, loadBudget } from 'loot-core/client/budgets/budgetsSlice';

function getFileDescription(file: File, t: (key: string) => string) {
if (file.state === 'unknown') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React, { useState, useEffect, useCallback } from 'react';
import { Trans, useTranslation } from 'react-i18next';

import { loggedIn, signOut } from 'loot-core/client/actions';
import { createBudget } from 'loot-core/client/budgets/budgetsSlice';
import {
isNonProductionEnvironment,
isElectron,
Expand All @@ -20,7 +21,6 @@ import { View } from '../common/View';
import { useServerURL, useSetServerURL } from '../ServerContext';

import { Title } from './subscribe/common';
import { createBudget } from 'loot-core/client/budgets/budgetsSlice';

export function ConfigServer() {
const { t } = useTranslation();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import { Trans, useTranslation } from 'react-i18next';

import { pushModal } from 'loot-core/client/actions';
import { createBudget } from 'loot-core/client/budgets/budgetsSlice';

import { useAppDispatch } from '../../redux';
import { styles, theme } from '../../style';
Expand All @@ -10,7 +11,6 @@ import { Link } from '../common/Link';
import { Paragraph } from '../common/Paragraph';
import { Text } from '../common/Text';
import { View } from '../common/View';
import { createBudget } from 'loot-core/client/budgets/budgetsSlice';

export function WelcomeScreen() {
const { t } = useTranslation();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import React, { useState } from 'react';
import { Trans, useTranslation } from 'react-i18next';

import { createBudget } from 'loot-core/client/budgets/budgetsSlice';
import { send } from 'loot-core/src/platform/client/fetch';

import { useNavigate } from '../../../hooks/useNavigate';
Expand All @@ -16,7 +17,6 @@ import { useRefreshLoginMethods } from '../../ServerContext';

import { useBootstrapped, Title } from './common';
import { ConfirmPasswordForm } from './ConfirmPasswordForm';
import { createBudget } from 'loot-core/client/budgets/budgetsSlice';

export function Bootstrap() {
const { t } = useTranslation();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { useTranslation, Trans } from 'react-i18next';
import { css } from '@emotion/css';

import { loadGlobalPrefs, sync } from 'loot-core/client/actions';
import { loadAllFiles } from 'loot-core/client/budgets/budgetsSlice';
import { send } from 'loot-core/src/platform/client/fetch';
import { getCreateKeyError } from 'loot-core/src/shared/errors';

Expand All @@ -25,7 +26,6 @@ import { Paragraph } from '../common/Paragraph';
import { Text } from '../common/Text';
import { View } from '../common/View';
import { useResponsive } from '../responsive/ResponsiveProvider';
import { loadAllFiles } from 'loot-core/client/budgets/budgetsSlice';

type CreateEncryptionKeyModalProps = {
options: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { useState } from 'react';
import { Trans, useTranslation } from 'react-i18next';

import { popModal } from 'loot-core/client/actions';
import { closeBudget } from 'loot-core/client/budgets/budgetsSlice';
import { send } from 'loot-core/platform/client/fetch';
import * as asyncStorage from 'loot-core/platform/server/asyncStorage';
import { getOpenIdErrors } from 'loot-core/shared/errors';
Expand All @@ -16,7 +17,6 @@ import { Modal, ModalCloseButton, ModalHeader } from '../common/Modal';
import { View } from '../common/View';
import { OpenIdForm } from '../manager/subscribe/OpenIdForm';
import { useRefreshLoginMethods } from '../ServerContext';
import { closeBudget } from 'loot-core/client/budgets/budgetsSlice';

type OpenIDEnableModalProps = {
onSave?: () => void;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import React from 'react';
import { Trans, useTranslation } from 'react-i18next';

import { closeBudget } from 'loot-core/client/budgets/budgetsSlice';

import { useAppDispatch } from '../../redux';
import { Button } from '../common/Button2';
import { Link } from '../common/Link';
import { Modal, ModalHeader, ModalTitle } from '../common/Modal';
import { Paragraph } from '../common/Paragraph';
import { Text } from '../common/Text';
import { View } from '../common/View';
import { closeBudget } from 'loot-core/client/budgets/budgetsSlice';

export function OutOfSyncMigrationsModal() {
const dispatch = useAppDispatch();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { useState } from 'react';
import { Trans, useTranslation } from 'react-i18next';

import { popModal } from 'loot-core/client/actions';
import { closeBudget } from 'loot-core/client/budgets/budgetsSlice';
import { send } from 'loot-core/platform/client/fetch';
import * as asyncStorage from 'loot-core/src/platform/server/asyncStorage';

Expand All @@ -22,7 +23,6 @@ import {
useMultiuserEnabled,
useRefreshLoginMethods,
} from '../ServerContext';
import { closeBudget } from 'loot-core/client/budgets/budgetsSlice';

type PasswordEnableModalProps = {
onSave?: () => void;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { useEffect, useState } from 'react';
import { Trans, useTranslation } from 'react-i18next';

import {
addNotification,
popModal,
} from 'loot-core/client/actions';
import { addNotification, popModal } from 'loot-core/client/actions';
import { closeAndLoadBudget } from 'loot-core/client/budgets/budgetsSlice';
import { send } from 'loot-core/platform/client/fetch';
import { getUserAccessErrors } from 'loot-core/shared/errors';
import { type Budget } from 'loot-core/types/budget';
Expand All @@ -21,7 +19,6 @@ import { Stack } from '../common/Stack';
import { Text } from '../common/Text';
import { View } from '../common/View';
import { FormField, FormLabel } from '../forms';
import { closeAndLoadBudget } from 'loot-core/client/budgets/budgetsSlice';

type TransferOwnershipProps = {
onSave?: () => void;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useState } from 'react';
import { Trans, useTranslation } from 'react-i18next';

import { deleteBudget } from 'loot-core/client/budgets/budgetsSlice';
import { type File } from 'loot-core/src/types/file';

import { useAppDispatch } from '../../../redux';
Expand All @@ -9,7 +10,6 @@ import { ButtonWithLoading } from '../../common/Button2';
import { Modal, ModalCloseButton, ModalHeader } from '../../common/Modal';
import { Text } from '../../common/Text';
import { View } from '../../common/View';
import { deleteBudget } from 'loot-core/client/budgets/budgetsSlice';

type DeleteFileProps = {
file: File;
Expand Down Expand Up @@ -73,7 +73,7 @@ export function DeleteFileModal({ file }: DeleteFileProps) {
deleteBudget({
id: 'id' in file ? file.id : undefined,
cloudFileId: file.cloudFileId,
}),
}),
);
setLoadingState(null);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import React, { useEffect, useState } from 'react';
import { Trans, useTranslation } from 'react-i18next';

import { addNotification } from 'loot-core/client/actions';
import { duplicateBudget } from 'loot-core/client/budgets/budgetsSlice';
import { send } from 'loot-core/platform/client/fetch';
import { type File } from 'loot-core/src/types/file';

import { useAppDispatch } from '../../../redux';
Expand All @@ -19,8 +21,6 @@ import {
} from '../../common/Modal';
import { Text } from '../../common/Text';
import { View } from '../../common/View';
import { send } from 'loot-core/platform/client/fetch';
import { duplicateBudget } from 'loot-core/client/budgets/budgetsSlice';

type DuplicateFileProps = {
file: File;
Expand Down Expand Up @@ -248,4 +248,4 @@ function validateBudgetName(name: string): {

function uniqueBudgetName(name: string): string {
return send('unique-budget-name', { name });
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { useState } from 'react';
import { Trans, useTranslation } from 'react-i18next';

import { pushModal } from 'loot-core/client/actions';
import { loadAllFiles } from 'loot-core/client/budgets/budgetsSlice';

import { useGlobalPref } from '../../../hooks/useGlobalPref';
import { SvgPencil1 } from '../../../icons/v2';
Expand All @@ -11,7 +12,6 @@ import { Button } from '../../common/Button2';
import { Modal, ModalCloseButton, ModalHeader } from '../../common/Modal';
import { Text } from '../../common/Text';
import { View } from '../../common/View';
import { loadAllFiles } from 'loot-core/client/budgets/budgetsSlice';

function FileLocationSettings() {
const [documentDir, _setDocumentDirPref] = useGlobalPref('documentDir');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import React, { useState } from 'react';
import { Trans, useTranslation } from 'react-i18next';

import { importBudget } from 'loot-core/client/budgets/budgetsSlice';

import { useNavigate } from '../../../hooks/useNavigate';
import { useAppDispatch } from '../../../redux';
import { styles, theme } from '../../../style';
Expand All @@ -10,7 +12,6 @@ import { ButtonWithLoading } from '../../common/Button2';
import { Modal, ModalCloseButton, ModalHeader } from '../../common/Modal';
import { Paragraph } from '../../common/Paragraph';
import { View } from '../../common/View';
import { importBudget } from 'loot-core/client/budgets/budgetsSlice';

function getErrorMessage(error: string): string {
switch (error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import React, { useState } from 'react';
import { Trans, useTranslation } from 'react-i18next';

import { importBudget } from 'loot-core/client/budgets/budgetsSlice';

import { useNavigate } from '../../../hooks/useNavigate';
import { useAppDispatch } from '../../../redux';
import { styles, theme } from '../../../style';
Expand All @@ -10,7 +12,6 @@ import { ButtonWithLoading } from '../../common/Button2';
import { Modal, ModalCloseButton, ModalHeader } from '../../common/Modal';
import { Paragraph } from '../../common/Paragraph';
import { View } from '../../common/View';
import { importBudget } from 'loot-core/client/budgets/budgetsSlice';

function getErrorMessage(error: string): string {
switch (error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import React, { useState } from 'react';
import { Trans, useTranslation } from 'react-i18next';

import { importBudget } from 'loot-core/client/budgets/budgetsSlice';

import { useNavigate } from '../../../hooks/useNavigate';
import { useAppDispatch } from '../../../redux';
import { styles, theme } from '../../../style';
Expand All @@ -11,7 +13,6 @@ import { Link } from '../../common/Link';
import { Modal, ModalCloseButton, ModalHeader } from '../../common/Modal';
import { Paragraph } from '../../common/Paragraph';
import { View } from '../../common/View';
import { importBudget } from 'loot-core/client/budgets/budgetsSlice';

function getErrorMessage(error: string): string {
switch (error) {
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop-client/src/components/settings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { useTranslation, Trans } from 'react-i18next';
import { css } from '@emotion/css';

import { loadPrefs } from 'loot-core/client/actions';
import { closeBudget } from 'loot-core/client/budgets/budgetsSlice';
import { isElectron } from 'loot-core/shared/environment';
import { listen } from 'loot-core/src/platform/client/fetch';

Expand Down Expand Up @@ -35,7 +36,6 @@ import { FormatSettings } from './Format';
import { ResetCache, ResetSync } from './Reset';
import { ThemeSettings } from './Themes';
import { AdvancedToggle, Setting } from './UI';
import { closeBudget } from 'loot-core/client/budgets/budgetsSlice';

function About() {
const version = useServerVersion();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { type ReactNode, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';

import { closeBudget } from 'loot-core/client/budgets/budgetsSlice';
import * as Platform from 'loot-core/src/client/platform';

import { useContextMenu } from '../../hooks/useContextMenu';
Expand All @@ -16,7 +17,6 @@ import { Menu } from '../common/Menu';
import { Popover } from '../common/Popover';
import { Text } from '../common/Text';
import { View } from '../common/View';
import { closeBudget } from 'loot-core/client/budgets/budgetsSlice';

type BudgetNameProps = {
children?: ReactNode;
Expand Down
Loading

0 comments on commit fb5f58e

Please sign in to comment.