Skip to content

Commit

Permalink
ESLint no default exports 4 (actualbudget#2118)
Browse files Browse the repository at this point in the history
* ESLint no-default-exports part 4

* Fix default imports

* Fix default imports

* Fix manager Modals import

* Release notes
  • Loading branch information
joel-jeremy authored Jan 6, 2024
1 parent 3aaf2a9 commit 47f1161
Show file tree
Hide file tree
Showing 68 changed files with 111 additions and 100 deletions.
9 changes: 9 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,15 @@ module.exports = {
'./packages/desktop-client/src/components/common/LinkButton.tsx',
'./packages/desktop-client/src/components/common/Menu.tsx',
'./packages/desktop-client/src/components/common/MenuTooltip.tsx',
'./packages/desktop-client/src/components/common/MenuButton.tsx',
'./packages/desktop-client/src/components/common/Modal.tsx',
'./packages/desktop-client/src/components/common/Paragraph.tsx',
'./packages/desktop-client/src/components/common/Search.tsx',
'./packages/desktop-client/src/components/common/Select.tsx',
'./packages/desktop-client/src/components/common/Stack.tsx',
// './packages/desktop-client/src/components/common/Text.tsx',
'./packages/desktop-client/src/components/common/TextOneLine.tsx',
// './packages/desktop-client/src/components/common/View.tsx',
// './packages/desktop-client/src/components/common/**/*',
// './packages/desktop-client/src/components/filters/**/*',
// './packages/desktop-client/src/components/gocardless/**/*',
Expand Down
6 changes: 3 additions & 3 deletions packages/desktop-client/src/components/FatalError.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { Block } from './common/Block';
import { Button } from './common/Button';
import { ExternalLink } from './common/ExternalLink';
import { LinkButton } from './common/LinkButton';
import Modal from './common/Modal';
import Paragraph from './common/Paragraph';
import Stack from './common/Stack';
import { Modal } from './common/Modal';
import { Paragraph } from './common/Paragraph';
import { Stack } from './common/Stack';
import Text from './common/Text';
import View from './common/View';
import { Checkbox } from './forms';
Expand Down
4 changes: 2 additions & 2 deletions packages/desktop-client/src/components/ManageRules.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import { theme } from '../style';

import { Button } from './common/Button';
import { ExternalLink } from './common/ExternalLink';
import Search from './common/Search';
import Stack from './common/Stack';
import { Search } from './common/Search';
import { Stack } from './common/Stack';
import Text from './common/Text';
import View from './common/View';
import RulesHeader from './rules/RulesHeader';
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop-client/src/components/Notifications.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { styles, theme, type CSSProperties } from '../style';
import { Button, ButtonWithLoading } from './common/Button';
import { ExternalLink } from './common/ExternalLink';
import { LinkButton } from './common/LinkButton';
import Stack from './common/Stack';
import { Stack } from './common/Stack';
import Text from './common/Text';
import View from './common/View';

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 @@ -31,7 +31,7 @@ import { MonthCountSelector } from './budget/MonthCountSelector';
import { Button, ButtonWithLoading } from './common/Button';
import { ExternalLink } from './common/ExternalLink';
import { Link } from './common/Link';
import Paragraph from './common/Paragraph';
import { Paragraph } from './common/Paragraph';
import Text from './common/Text';
import View from './common/View';
import { KeyHandlers } from './KeyHandlers';
Expand Down
6 changes: 3 additions & 3 deletions packages/desktop-client/src/components/accounts/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import { Button } from '../common/Button';
import { InitialFocus } from '../common/InitialFocus';
import { Input } from '../common/Input';
import { Menu } from '../common/Menu';
import MenuButton from '../common/MenuButton';
import { MenuButton } from '../common/MenuButton';
import { MenuTooltip } from '../common/MenuTooltip';
import Search from '../common/Search';
import Stack from '../common/Stack';
import { Search } from '../common/Search';
import { Stack } from '../common/Stack';
import View from '../common/View';
import { FilterButton } from '../filters/FiltersMenu';
import { FiltersStack } from '../filters/SavedFilters';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Add from '../../icons/v1/Add';
import { theme, styles } from '../../style';
import { Button } from '../common/Button';
import Text from '../common/Text';
import TextOneLine from '../common/TextOneLine';
import { TextOneLine } from '../common/TextOneLine';
import View from '../common/View';
import { Page } from '../Page';
import PullToRefresh from '../responsive/PullToRefresh';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import ArrowButtonUp1 from '../../../../icons/v2/ArrowButtonUp1';
import { theme, styles } from '../../../../style';
import { Button } from '../../../common/Button';
import { Menu } from '../../../common/Menu';
import Stack from '../../../common/Stack';
import { Stack } from '../../../common/Stack';
import View from '../../../common/View';
import { NotesButton } from '../../../NotesButton';
import NamespaceContext from '../../../spreadsheet/NamespaceContext';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import DotsHorizontalTriple from '../../icons/v1/DotsHorizontalTriple';

import { Button } from './Button';

export default function MenuButton({ onClick }) {
export function MenuButton({ onClick }) {
return (
<Button type="bare" onClick={onClick} aria-label="Menu">
<DotsHorizontalTriple
Expand Down
4 changes: 1 addition & 3 deletions packages/desktop-client/src/components/common/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export type ModalProps = {
onTitleUpdate?: (title: string) => void;
};

const Modal = ({
export const Modal = ({
title,
isCurrent,
isHidden,
Expand Down Expand Up @@ -427,5 +427,3 @@ export const ModalButtons = ({
</View>
);
};

export default Modal;
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type ParagraphProps = HTMLProps<HTMLDivElement> & {
isLast?: boolean;
};

export default function Paragraph({
export function Paragraph({
style,
isLast,
children,
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop-client/src/components/common/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type SearchProps = {
width?: number;
};

export default function Search({
export function Search({
inputRef,
value,
onChange,
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop-client/src/components/common/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ type SelectProps<Value extends string> = {
* // <Select options={[['1', 'Option 1'], ['2', 'Option 2']]} value="3" defaultLabel="Select an option" onChange={handleOnChange} />
*/

export default function Select<Value extends string>({
export function Select<Value extends string>({
bare,
options,
value,
Expand Down
4 changes: 1 addition & 3 deletions packages/desktop-client/src/components/common/Stack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type StackProps = ComponentProps<typeof View> & {
spacing?: number;
debug?: boolean;
};
const Stack = forwardRef<HTMLDivElement, StackProps>(
export const Stack = forwardRef<HTMLDivElement, StackProps>(
(
{
direction = 'column',
Expand Down Expand Up @@ -91,5 +91,3 @@ const Stack = forwardRef<HTMLDivElement, StackProps>(
);
},
);

export default Stack;
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Text from './Text';

type TextOneLineProps = ComponentProps<typeof Text>;

export default function TextOneLine({ children, ...props }: TextOneLineProps) {
export function TextOneLine({ children, ...props }: TextOneLineProps) {
return (
<Text
{...props}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import { theme } from '../../style';
import { Button } from '../common/Button';
import { HoverTarget } from '../common/HoverTarget';
import { Menu } from '../common/Menu';
import Select from '../common/Select';
import Stack from '../common/Stack';
import { Select } from '../common/Select';
import { Stack } from '../common/Stack';
import Text from '../common/Text';
import View from '../common/View';
import Value from '../rules/Value';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { theme } from '../../style';
import { Button } from '../common/Button';
import { Menu } from '../common/Menu';
import { MenuTooltip } from '../common/MenuTooltip';
import Stack from '../common/Stack';
import { Stack } from '../common/Stack';
import Text from '../common/Text';
import View from '../common/View';
import { FormField, FormLabel } from '../forms';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';

import Modal from '../common/Modal';
import Paragraph from '../common/Paragraph';
import { Modal } from '../common/Modal';
import { Paragraph } from '../common/Paragraph';
import View from '../common/View';

export default function GoCardlessLink() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { type BoundActions } from '../../hooks/useActions';
import { theme } from '../../style';
import { type CommonModalProps } from '../../types/modals';
import { ButtonWithLoading } from '../common/Button';
import Modal from '../common/Modal';
import { Modal } from '../common/Modal';
import Text from '../common/Text';
import View from '../common/View';

Expand Down
2 changes: 1 addition & 1 deletion packages/desktop-client/src/components/manager/Import.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { styles, theme } from '../../style';
import { type CommonModalProps } from '../../types/modals';
import { Block } from '../common/Block';
import { Button } from '../common/Button';
import Modal from '../common/Modal';
import { Modal } from '../common/Modal';
import Text from '../common/Text';
import View from '../common/View';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { importBudget } from 'loot-core/src/client/actions/budgets';
import { styles, theme } from '../../style';
import { Block } from '../common/Block';
import { ButtonWithLoading } from '../common/Button';
import Modal, { type ModalProps } from '../common/Modal';
import Paragraph from '../common/Paragraph';
import { Modal, type ModalProps } from '../common/Modal';
import { Paragraph } from '../common/Paragraph';
import View from '../common/View';

function getErrorMessage(error: string): string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { importBudget } from 'loot-core/src/client/actions/budgets';
import { styles, theme } from '../../style';
import { Block } from '../common/Block';
import { ButtonWithLoading } from '../common/Button';
import Modal, { type ModalProps } from '../common/Modal';
import Paragraph from '../common/Paragraph';
import { Modal, type ModalProps } from '../common/Modal';
import { Paragraph } from '../common/Paragraph';
import View from '../common/View';

function getErrorMessage(error: string): string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { styles, theme } from '../../style';
import { Block } from '../common/Block';
import { ButtonWithLoading } from '../common/Button';
import { ExternalLink } from '../common/ExternalLink';
import Modal, { type ModalProps } from '../common/Modal';
import Paragraph from '../common/Paragraph';
import { Modal, type ModalProps } from '../common/Modal';
import { Paragraph } from '../common/Paragraph';
import View from '../common/View';

function getErrorMessage(error: string): string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useActions } from '../../hooks/useActions';
import { styles, theme } from '../../style';
import { Button } from '../common/Button';
import { ExternalLink } from '../common/ExternalLink';
import Paragraph from '../common/Paragraph';
import { Paragraph } from '../common/Paragraph';
import Text from '../common/Text';
import View from '../common/View';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { send } from 'loot-core/src/platform/client/fetch';
import { theme } from '../../../style';
import { Button } from '../../common/Button';
import { ExternalLink } from '../../common/ExternalLink';
import Paragraph from '../../common/Paragraph';
import { Paragraph } from '../../common/Paragraph';
import Text from '../../common/Text';
import View from '../../common/View';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { type CSSProperties, styles, theme } from '../../style';
import { type CommonModalProps } from '../../types/modals';
import { Button } from '../common/Button';
import { Menu } from '../common/Menu';
import Modal from '../common/Modal';
import { Modal } from '../common/Modal';
import View from '../common/View';
import { Notes } from '../Notes';
import { Tooltip } from '../tooltips';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { type CSSProperties, styles, theme } from '../../style';
import { type CommonModalProps } from '../../types/modals';
import { Button } from '../common/Button';
import { Menu } from '../common/Menu';
import Modal from '../common/Modal';
import { Modal } from '../common/Modal';
import View from '../common/View';
import { Notes } from '../Notes';
import { Tooltip } from '../tooltips';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import CategoryAutocomplete from '../autocomplete/CategoryAutocomplete';
import { Button } from '../common/Button';
import { FormError } from '../common/FormError';
import { LinkButton } from '../common/LinkButton';
import Modal from '../common/Modal';
import Paragraph from '../common/Paragraph';
import { Modal } from '../common/Modal';
import { Paragraph } from '../common/Paragraph';
import Text from '../common/Text';
import View from '../common/View';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { type CommonModalProps } from '../../types/modals';
import CategoryAutocomplete from '../autocomplete/CategoryAutocomplete';
import { Block } from '../common/Block';
import { Button } from '../common/Button';
import Modal from '../common/Modal';
import { Modal } from '../common/Modal';
import Text from '../common/Text';
import View from '../common/View';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from 'react';
import { type CommonModalProps } from '../../types/modals';
import { Block } from '../common/Block';
import { Button } from '../common/Button';
import Modal from '../common/Modal';
import { Modal } from '../common/Modal';
import View from '../common/View';

type ConfirmTransactionEditProps = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import { theme } from '../../style';
import { type CommonModalProps } from '../../types/modals';
import { Button, ButtonWithLoading } from '../common/Button';
import { ExternalLink } from '../common/ExternalLink';
import Modal from '../common/Modal';
import Paragraph from '../common/Paragraph';
import { Modal } from '../common/Modal';
import { Paragraph } from '../common/Paragraph';
import Text from '../common/Text';
import View from '../common/View';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import { ButtonWithLoading } from '../common/Button';
import { ExternalLink } from '../common/ExternalLink';
import { InitialFocus } from '../common/InitialFocus';
import { Input } from '../common/Input';
import Modal, { ModalButtons } from '../common/Modal';
import Paragraph from '../common/Paragraph';
import { Modal, ModalButtons } from '../common/Modal';
import { Paragraph } from '../common/Paragraph';
import Text from '../common/Text';
import View from '../common/View';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { FormError } from '../common/FormError';
import { InitialFocus } from '../common/InitialFocus';
import { InlineField } from '../common/InlineField';
import { Input } from '../common/Input';
import Modal, { ModalButtons } from '../common/Modal';
import { Modal, ModalButtons } from '../common/Modal';
import Text from '../common/Text';
import View from '../common/View';
import { Checkbox } from '../forms';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import PayeeAutocomplete, {
PayeeItem,
} from '../autocomplete/PayeeAutocomplete';
import { Input } from '../common/Input';
import Modal from '../common/Modal';
import { Modal } from '../common/Modal';
import View from '../common/View';
import { SectionLabel } from '../forms';
import DateSelect from '../select/DateSelect';
Expand Down
6 changes: 3 additions & 3 deletions packages/desktop-client/src/components/modals/EditRule.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ import SubtractIcon from '../../icons/v0/Subtract';
import InformationOutline from '../../icons/v1/InformationOutline';
import { theme } from '../../style';
import { Button } from '../common/Button';
import Modal from '../common/Modal';
import Select from '../common/Select';
import Stack from '../common/Stack';
import { Modal } from '../common/Modal';
import { Select } from '../common/Select';
import { Stack } from '../common/Stack';
import Text from '../common/Text';
import View from '../common/View';
import { StatusBadge } from '../schedules/StatusBadge';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import { Button, ButtonWithLoading } from '../common/Button';
import { ExternalLink } from '../common/ExternalLink';
import { InitialFocus } from '../common/InitialFocus';
import { Input } from '../common/Input';
import Modal, { ModalButtons } from '../common/Modal';
import Paragraph from '../common/Paragraph';
import { Modal, ModalButtons } from '../common/Modal';
import { Paragraph } from '../common/Paragraph';
import Text from '../common/Text';
import View from '../common/View';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import { Button } from '../common/Button';
import { ExternalLink } from '../common/ExternalLink';
import { LinkButton } from '../common/LinkButton';
import { Menu } from '../common/Menu';
import Modal from '../common/Modal';
import Paragraph from '../common/Paragraph';
import { Modal } from '../common/Modal';
import { Paragraph } from '../common/Paragraph';
import View from '../common/View';
import { FormField, FormLabel } from '../forms';
import { Tooltip } from '../tooltips';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Error } from '../alerts';
import { ButtonWithLoading } from '../common/Button';
import { ExternalLink } from '../common/ExternalLink';
import { Input } from '../common/Input';
import Modal, { ModalButtons } from '../common/Modal';
import { Modal, ModalButtons } from '../common/Modal';
import type { ModalProps } from '../common/Modal';
import Text from '../common/Text';
import View from '../common/View';
Expand Down
Loading

0 comments on commit 47f1161

Please sign in to comment.