Skip to content

Commit

Permalink
ESLint no-default-exports 7 (actualbudget#2169)
Browse files Browse the repository at this point in the history
* Fix default imports

* Fix manager Modals import

* ESLint no default exports 7

* Release notes
  • Loading branch information
joel-jeremy authored Jan 6, 2024
1 parent 8b9c316 commit 6acf75f
Show file tree
Hide file tree
Showing 62 changed files with 167 additions and 182 deletions.
6 changes: 3 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,9 @@ module.exports = {
'./packages/crdt/**/*',
'./packages/desktop-client/src/*',
'./packages/desktop-client/src/components/*',
// './packages/desktop-client/src/components/accounts/**/*',
// './packages/desktop-client/src/components/autocomplete/**/*',
// './packages/desktop-client/src/components/budget/**/*',
'./packages/desktop-client/src/components/accounts/**/*',
'./packages/desktop-client/src/components/autocomplete/**/*',
'./packages/desktop-client/src/components/budget/**/*',
'./packages/desktop-client/src/components/common/**/*',
// './packages/desktop-client/src/components/filters/**/*',
// './packages/desktop-client/src/components/gocardless/**/*',
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop-client/src/components/Titlebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import ViewShow from '../icons/v2/ViewShow';
import { useResponsive } from '../ResponsiveProvider';
import { theme, type CSSProperties, styles } from '../style';

import AccountSyncCheck from './accounts/AccountSyncCheck';
import { AccountSyncCheck } from './accounts/AccountSyncCheck';
import { AnimatedRefresh } from './AnimatedRefresh';
import { MonthCountSelector } from './budget/MonthCountSelector';
import { Button, ButtonWithLoading } from './common/Button';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1473,7 +1473,7 @@ function AccountHack(props) {
);
}

export default function Account() {
export function Account() {
const params = useParams();
const location = useLocation();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function getErrorMessage(type, code) {
);
}

export default function AccountSyncCheck() {
export function AccountSyncCheck() {
const accounts = useSelector(state => state.queries.accounts);
const failedAccounts = useSelector(state => state.account.failedAccounts);
const { unlinkAccount, pushModal } = useActions();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import useNavigate from '../../hooks/useNavigate';
import { useSetThemeColor } from '../../hooks/useSetThemeColor';
import { theme } from '../../style';

import AccountDetails from './MobileAccountDetails';
import { AccountDetails } from './MobileAccountDetails';

const getSchedulesTransform = memoizeOne((id, hasSearch) => {
let filter = queries.getAccountFilter(id, '_account');
Expand Down Expand Up @@ -68,7 +68,7 @@ function PreviewTransactions({ accountId, children }) {

let paged;

export default function Account(props) {
export function Account(props) {
const accounts = useSelector(state => state.queries.accounts);

const navigate = useNavigate();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function TransactionSearchInput({ accountName, onSearch }) {
);
}

export default function AccountDetails({
export function AccountDetails({
account,
prependTransactions,
transactions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ function AccountList({
);
}

export default function Accounts() {
export function Accounts() {
const accounts = useSelector(state => state.queries.accounts);
const newTransactions = useSelector(state => state.queries.newTransactions);
const updatedAccounts = useSelector(state => state.queries.updatedAccounts);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { useResponsive } from '../../ResponsiveProvider';
import { type CSSProperties, theme } from '../../style';
import { View } from '../common/View';

import Autocomplete from './Autocomplete';
import { Autocomplete } from './Autocomplete';

function AccountList({
items,
Expand Down Expand Up @@ -77,7 +77,7 @@ type AccountAutoCompleteProps = {
closeOnBlur?: boolean;
} & ComponentProps<typeof Autocomplete>;

export default function AccountAutocomplete({
export function AccountAutocomplete({
embedded,
includeClosedAccounts = true,
renderAccountItemGroupHeader,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ function isMultiAutocomplete<T extends Item>(
return multi;
}

export default function Autocomplete<T extends Item>({
export function Autocomplete<T extends Item>({
multi,
...props
}: AutocompleteProps<T> & { multi?: boolean }) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { type CSSProperties, theme } from '../../style';
import { Text } from '../common/Text';
import { View } from '../common/View';

import Autocomplete, { defaultFilterSuggestion } from './Autocomplete';
import { Autocomplete, defaultFilterSuggestion } from './Autocomplete';

export type CategoryListProps = {
items: Array<CategoryEntity & { group?: CategoryGroupEntity }>;
Expand Down Expand Up @@ -107,7 +107,7 @@ type CategoryAutocompleteProps = ComponentProps<typeof Autocomplete> & {
renderCategoryItem?: (props: CategoryItemProps) => ReactNode;
};

export default function CategoryAutocomplete({
export function CategoryAutocomplete({
categoryGroups,
showSplitOption,
embedded,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ import { type CSSProperties, theme } from '../../style';
import { Button } from '../common/Button';
import { View } from '../common/View';

import Autocomplete, {
import {
Autocomplete,
defaultFilterSuggestion,
AutocompleteFooter,
} from './Autocomplete';
Expand Down Expand Up @@ -167,7 +168,7 @@ type PayeeAutocompleteProps = {
payees?: PayeeEntity[];
};

export default function PayeeAutocomplete({
export function PayeeAutocomplete({
value,
inputProps,
showMakeTransfer = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { type TransactionFilterEntity } from 'loot-core/src/types/models';
import { theme } from '../../style';
import { View } from '../common/View';

import Autocomplete from './Autocomplete';
import { Autocomplete } from './Autocomplete';

type FilterListProps<T> = {
items: T[];
Expand Down Expand Up @@ -60,7 +60,7 @@ type SavedFilterAutocompleteProps = {
embedded?: boolean;
} & ComponentProps<typeof Autocomplete<TransactionFilterEntity>>;

export default function SavedFilterAutocomplete({
export function SavedFilterAutocomplete({
embedded,
...props
}: SavedFilterAutocompleteProps) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type BalanceWithCarryoverProps = {
balanceStyle?: CSSProperties;
carryoverStyle?: CSSProperties;
};
export default function BalanceWithCarryover({
export function BalanceWithCarryover({
carryover,
balance,
goal,
Expand Down
18 changes: 8 additions & 10 deletions packages/desktop-client/src/components/budget/BudgetCategories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ import { View } from '../common/View';
import { DropHighlightPosContext } from '../sort';
import { Row } from '../table';

import ExpenseCategory from './ExpenseCategory';
import ExpenseGroup from './ExpenseGroup';
import IncomeCategory from './IncomeCategory';
import IncomeGroup from './IncomeGroup';
import IncomeHeader from './IncomeHeader';
import SidebarCategory from './SidebarCategory';
import SidebarGroup from './SidebarGroup';
import { ExpenseCategory } from './ExpenseCategory';
import { ExpenseGroup } from './ExpenseGroup';
import { IncomeCategory } from './IncomeCategory';
import { IncomeGroup } from './IncomeGroup';
import { IncomeHeader } from './IncomeHeader';
import { SidebarCategory } from './SidebarCategory';
import { SidebarGroup } from './SidebarGroup';
import { separateGroups } from './util';

const BudgetCategories = memo(
export const BudgetCategories = memo(
({
categoryGroups,
newCategoryForGroup,
Expand Down Expand Up @@ -313,5 +313,3 @@ const BudgetCategories = memo(
);
},
);

export default BudgetCategories;
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type BudgetPageHeaderProps = {
monthBounds: ComponentProps<typeof MonthPicker>['monthBounds'];
};

const BudgetPageHeader = memo<BudgetPageHeaderProps>(
export const BudgetPageHeader = memo<BudgetPageHeaderProps>(
({ startMonth, onMonthSelect, numMonths, monthBounds }) => {
function getValidMonth(month) {
const start = monthBounds.start;
Expand Down Expand Up @@ -43,5 +43,3 @@ const BudgetPageHeader = memo<BudgetPageHeaderProps>(
);
},
);

export default BudgetPageHeader;
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,14 @@ import useResizeObserver from '../../hooks/useResizeObserver';
import { View } from '../common/View';

import { MonthsContext } from './MonthsContext';
import type ReportBudgetSummary from './report/budgetsummary/BudgetSummary';
import type RolloverBudgetSummary from './rollover/budgetsummary/BudgetSummary';
import { type BudgetSummary as ReportBudgetSummary } from './report/budgetsummary/BudgetSummary';
import { type BudgetSummary as RolloverBudgetSummary } from './rollover/budgetsummary/BudgetSummary';

type BudgetSummariesProps = {
SummaryComponent: typeof ReportBudgetSummary | typeof RolloverBudgetSummary;
};

export default function BudgetSummaries({
SummaryComponent,
}: BudgetSummariesProps) {
export function BudgetSummaries({ SummaryComponent }: BudgetSummariesProps) {
const { months } = useContext(MonthsContext);

const [widthState, setWidthState] = useState(0);
Expand Down
10 changes: 4 additions & 6 deletions packages/desktop-client/src/components/budget/BudgetTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import { theme, styles } from '../../style';
import { View } from '../common/View';
import { IntersectionBoundary } from '../tooltips';

import BudgetCategories from './BudgetCategories';
import BudgetSummaries from './BudgetSummaries';
import BudgetTotals from './BudgetTotals';
import { BudgetCategories } from './BudgetCategories';
import { BudgetSummaries } from './BudgetSummaries';
import { BudgetTotals } from './BudgetTotals';
import { MonthsProvider } from './MonthsContext';
import { findSortDown, findSortUp, getScrollbarWidth } from './util';

class BudgetTable extends Component {
export class BudgetTable extends Component {
constructor(props) {
super(props);
this.budgetCategoriesRef = createRef();
Expand Down Expand Up @@ -285,5 +285,3 @@ class BudgetTable extends Component {
);
}
}

export default BudgetTable;
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Menu } from '../common/Menu';
import { View } from '../common/View';
import { Tooltip } from '../tooltips';

import RenderMonths from './RenderMonths';
import { RenderMonths } from './RenderMonths';
import { getScrollbarWidth } from './util';

type BudgetTotalsProps = {
Expand All @@ -17,7 +17,7 @@ type BudgetTotalsProps = {
collapseAllCategories: () => void;
};

const BudgetTotals = memo(function BudgetTotals({
export const BudgetTotals = memo(function BudgetTotals({
MonthComponent,
toggleHiddenCategories,
expandAllCategories,
Expand Down Expand Up @@ -109,5 +109,3 @@ const BudgetTotals = memo(function BudgetTotals({
</View>
);
});

export default BudgetTotals;
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { useActions } from '../../hooks/useActions';
import { View } from '../common/View';

import { useBudgetMonthCount } from './BudgetMonthCountContext';
import BudgetPageHeader from './BudgetPageHeader';
import BudgetTable from './BudgetTable';
import { BudgetPageHeader } from './BudgetPageHeader';
import { BudgetTable } from './BudgetTable';

function getNumPossibleMonths(width: number) {
const estimatedTableWidth = width - 200;
Expand Down Expand Up @@ -100,19 +100,20 @@ const DynamicBudgetTableInner = forwardRef<
},
);

export default forwardRef<BudgetTable, DynamicBudgetTableInnerProps>(
(props, ref) => {
return (
<AutoSizer>
{({ width, height }) => (
<DynamicBudgetTableInner
ref={ref}
width={width}
height={height}
{...props}
/>
)}
</AutoSizer>
);
},
);
export const DynamicBudgetTable = forwardRef<
BudgetTable,
DynamicBudgetTableInnerProps
>((props, ref) => {
return (
<AutoSizer>
{({ width, height }) => (
<DynamicBudgetTableInner
ref={ref}
width={width}
height={height}
{...props}
/>
)}
</AutoSizer>
);
});
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import {
} from '../sort';
import { Row } from '../table';

import RenderMonths from './RenderMonths';
import SidebarCategory from './SidebarCategory';
import { RenderMonths } from './RenderMonths';
import { SidebarCategory } from './SidebarCategory';

type ExpenseCategoryProps = {
cat: CategoryEntity;
Expand All @@ -32,7 +32,7 @@ type ExpenseCategoryProps = {
onReorder: OnDropCallback;
};

function ExpenseCategory({
export function ExpenseCategory({
cat,
editingCell,
dragState,
Expand Down Expand Up @@ -108,5 +108,3 @@ function ExpenseCategory({
</Row>
);
}

export default ExpenseCategory;
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import {
} from '../sort';
import { Row, ROW_HEIGHT } from '../table';

import RenderMonths from './RenderMonths';
import SidebarGroup from './SidebarGroup';
import { RenderMonths } from './RenderMonths';
import { SidebarGroup } from './SidebarGroup';

type ExpenseGroupProps = {
group: ComponentProps<typeof SidebarGroup>['group'];
Expand All @@ -33,7 +33,7 @@ type ExpenseGroupProps = {
onShowNewCategory?: ComponentProps<typeof SidebarGroup>['onShowNewCategory'];
};

function ExpenseGroup({
export function ExpenseGroup({
group,
collapsed,
editingCell,
Expand Down Expand Up @@ -131,5 +131,3 @@ function ExpenseGroup({
</Row>
);
}

export default ExpenseGroup;
Loading

0 comments on commit 6acf75f

Please sign in to comment.