Skip to content

Commit

Permalink
feat(lint): sort svelte imports (#2270)
Browse files Browse the repository at this point in the history
# Motivation

More svelte imports sorted.
  • Loading branch information
AntonioVentilii-DFINITY authored Sep 6, 2024
1 parent 9362690 commit bdd2c9c
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 43 deletions.
1 change: 1 addition & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ module.exports = {
'src/frontend/src/icp/**/*.svelte',
'src/frontend/src/icp-eth/**/*.svelte',
'src/frontend/src/lib/components/common/**/*.svelte',
'src/frontend/src/lib/components/core/**/*.svelte',
'src/frontend/src/lib/components/exchange/**/*.svelte',
'src/frontend/src/lib/components/guard/**/*.svelte',
'src/frontend/src/lib/components/icons/**/*.svelte',
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/src/lib/components/core/Back.svelte
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<script lang="ts">
import { IconBack } from '@dfinity/gix-components';
import { back } from '$lib/utils/nav.utils';
import { nonNullish } from '@dfinity/utils';
import type { NavigationTarget } from '@sveltejs/kit';
import { afterNavigate } from '$app/navigation';
import { i18n } from '$lib/stores/i18n.store';
import { nonNullish } from '@dfinity/utils';
import { back } from '$lib/utils/nav.utils';
let fromRoute: NavigationTarget | null;
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/src/lib/components/core/Erc20Icp.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { ERC20_ICP_REPO_URL } from '$eth/constants/erc20-icp.constants';
import { IconInfo } from '@dfinity/gix-components';
import { ERC20_ICP_REPO_URL } from '$eth/constants/erc20-icp.constants';
import { i18n } from '$lib/stores/i18n.store';
</script>

Expand Down
8 changes: 4 additions & 4 deletions src/frontend/src/lib/components/core/Listener.svelte
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<script lang="ts">
import { isNullish } from '@dfinity/utils';
import type { ComponentType } from 'svelte';
import type { OptionToken } from '$lib/types/token';
import BitcoinListener from '$btc/components/BitcoinListener.svelte';
import EthListener from '$eth/components/core/EthListener.svelte';
import { isNetworkIdBitcoin, isNetworkIdICP } from '$lib/utils/network.utils';
import { isNullish } from '@dfinity/utils';
import NoListener from '$lib/components/core/NoListener.svelte';
import { authSignedIn } from '$lib/derived/auth.derived';
import BitcoinListener from '$btc/components/BitcoinListener.svelte';
import type { OptionToken } from '$lib/types/token';
import { isNetworkIdBitcoin, isNetworkIdICP } from '$lib/utils/network.utils';
export let token: OptionToken;
Expand Down
12 changes: 6 additions & 6 deletions src/frontend/src/lib/components/core/Loader.svelte
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<script lang="ts">
import { Modal, type ProgressStep } from '@dfinity/gix-components';
import InProgress from '$lib/components/ui/InProgress.svelte';
import { onMount } from 'svelte';
import { loadAddresses, loadIdbAddresses } from '$lib/services/address.services';
import { fade } from 'svelte/transition';
import { signOut } from '$lib/services/auth.services';
import { loadErc20Tokens } from '$eth/services/erc20.services';
import { loadIcrcTokens } from '$icp/services/icrc.services';
import banner from '$lib/assets/banner.svg';
import Img from '$lib/components/ui/Img.svelte';
import { loading } from '$lib/stores/loader.store';
import InProgress from '$lib/components/ui/InProgress.svelte';
import { ProgressStepsLoader } from '$lib/enums/progress-steps';
import { loadIcrcTokens } from '$icp/services/icrc.services';
import { i18n } from '$lib/stores/i18n.store';
import { loadAddresses, loadIdbAddresses } from '$lib/services/address.services';
import { signOut } from '$lib/services/auth.services';
import { authStore } from '$lib/stores/auth.store';
import { i18n } from '$lib/stores/i18n.store';
import { loading } from '$lib/stores/loader.store';
let progressStep: string = ProgressStepsLoader.ADDRESSES;
Expand Down
6 changes: 3 additions & 3 deletions src/frontend/src/lib/components/core/Loaders.svelte
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<script lang="ts">
import IcLoaderWallets from '$icp/components/core/IcLoaderWallets.svelte';
import LoaderBalances from '$icp-eth/components/core/LoaderBalances.svelte';
import AddressGuard from '$lib/components/guard/AddressGuard.svelte';
import ExchangeWorker from '$lib/components/exchange/ExchangeWorker.svelte';
import Loader from '$lib/components/core/Loader.svelte';
import LoaderMetamask from '$lib/components/core/LoaderMetamask.svelte';
import IcLoaderWallets from '$icp/components/core/IcLoaderWallets.svelte';
import ExchangeWorker from '$lib/components/exchange/ExchangeWorker.svelte';
import AddressGuard from '$lib/components/guard/AddressGuard.svelte';
</script>

<AddressGuard>
Expand Down
24 changes: 12 additions & 12 deletions src/frontend/src/lib/components/core/Menu.svelte
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<script lang="ts">
import { Popover } from '@dfinity/gix-components';
import { goto } from '$app/navigation';
import { page } from '$app/stores';
import MenuWallet from '$lib/components/core/MenuWallet.svelte';
import SignOut from '$lib/components/core/SignOut.svelte';
import AboutHow from '$lib/components/hero/about/AboutHow.svelte';
import AboutWhat from '$lib/components/hero/about/AboutWhat.svelte';
import IconGitHub from '$lib/components/icons/IconGitHub.svelte';
import IconSettings from '$lib/components/icons/IconSettings.svelte';
import IconUser from '$lib/components/icons/IconUser.svelte';
import ButtonHero from '$lib/components/ui/ButtonHero.svelte';
import ButtonMenu from '$lib/components/ui/ButtonMenu.svelte';
import ExternalLink from '$lib/components/ui/ExternalLink.svelte';
import Hr from '$lib/components/ui/Hr.svelte';
import { goto } from '$app/navigation';
import { OISY_REPO_URL } from '$lib/constants/oisy.constants';
import { NAVIGATION_MENU_BUTTON, NAVIGATION_MENU } from '$lib/constants/test-ids.constants';
import IconUser from '$lib/components/icons/IconUser.svelte';
import { networkId } from '$lib/derived/network.derived';
import { isRouteSettings, networkParam } from '$lib/utils/nav.utils';
import ExternalLink from '$lib/components/ui/ExternalLink.svelte';
import IconSettings from '$lib/components/icons/IconSettings.svelte';
import IconGitHub from '$lib/components/icons/IconGitHub.svelte';
import { i18n } from '$lib/stores/i18n.store';
import ButtonMenu from '$lib/components/ui/ButtonMenu.svelte';
import ButtonHero from '$lib/components/ui/ButtonHero.svelte';
import MenuWallet from '$lib/components/core/MenuWallet.svelte';
import { page } from '$app/stores';
import AboutHow from '$lib/components/hero/about/AboutHow.svelte';
import AboutWhat from '$lib/components/hero/about/AboutWhat.svelte';
import { replaceOisyPlaceholders } from '$lib/utils/i18n.utils';
import { isRouteSettings, networkParam } from '$lib/utils/nav.utils';
let visible = false;
let button: HTMLButtonElement | undefined;
Expand Down
18 changes: 9 additions & 9 deletions src/frontend/src/lib/components/core/MenuWallet.svelte
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<script lang="ts">
import { createEventDispatcher } from 'svelte';
import EthWalletAddress from '$eth/components/core/EthWalletAddress.svelte';
import { walletConnectPaired } from '$eth/stores/wallet-connect.store';
import IcWalletAddress from '$icp/components/core/IcWalletAddress.svelte';
import WalletAddresses from '$lib/components/core/WalletAddresses.svelte';
import IconWalletConnect from '$lib/components/icons/IconWalletConnect.svelte';
import ButtonMenu from '$lib/components/ui/ButtonMenu.svelte';
import Hr from '$lib/components/ui/Hr.svelte';
import { TRACK_COUNT_WALLET_CONNECT_MENU_OPEN } from '$lib/constants/analytics.contants';
import {
networkEthereum,
networkICP,
pseudoNetworkChainFusion
} from '$lib/derived/network.derived';
import EthWalletAddress from '$eth/components/core/EthWalletAddress.svelte';
import IcWalletAddress from '$icp/components/core/IcWalletAddress.svelte';
import { trackEvent } from '$lib/services/analytics.services';
import { i18n } from '$lib/stores/i18n.store';
import ButtonMenu from '$lib/components/ui/ButtonMenu.svelte';
import WalletAddresses from '$lib/components/core/WalletAddresses.svelte';
import IconWalletConnect from '$lib/components/icons/IconWalletConnect.svelte';
import { modalStore } from '$lib/stores/modal.store';
import { walletConnectPaired } from '$eth/stores/wallet-connect.store';
import { createEventDispatcher } from 'svelte';
import { trackEvent } from '$lib/services/analytics.services';
import { TRACK_COUNT_WALLET_CONNECT_MENU_OPEN } from '$lib/constants/analytics.contants';
const dispatch = createEventDispatcher();
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/src/lib/components/core/Modals.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script lang="ts">
import { modalHideToken, modalIcHideToken } from '$lib/derived/modal.derived';
import IcHideTokenModal from '$icp/components/tokens/IcHideTokenModal.svelte';
import HideTokenModal from '$eth/components/tokens/HideTokenModal.svelte';
import IcHideTokenModal from '$icp/components/tokens/IcHideTokenModal.svelte';
import { authSignedIn } from '$lib/derived/auth.derived';
import { modalHideToken, modalIcHideToken } from '$lib/derived/modal.derived';
/**
* Modals that must be declared at the root of the layout if they are used across routes - available on navigation.
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/src/lib/components/core/SignOut.svelte
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<script lang="ts">
import { signOut } from '$lib/services/auth.services';
import { createEventDispatcher } from 'svelte';
import IconLogout from '$lib/components/icons/IconLogout.svelte';
import { i18n } from '$lib/stores/i18n.store';
import { LOGOUT_BUTTON } from '$lib/constants/test-ids.constants';
import { signOut } from '$lib/services/auth.services';
import { i18n } from '$lib/stores/i18n.store';
const dispatch = createEventDispatcher();
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/src/lib/components/core/WalletAddresses.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script lang="ts">
import { createEventDispatcher } from 'svelte';
import IconCopy from '$lib/components/icons/IconCopy.svelte';
import { i18n } from '$lib/stores/i18n.store';
import { emit } from '$lib/utils/events.utils';
import IconCopy from '$lib/components/icons/IconCopy.svelte';
import { createEventDispatcher } from 'svelte';
const dispatch = createEventDispatcher();
Expand Down

0 comments on commit bdd2c9c

Please sign in to comment.