Skip to content

Commit

Permalink
Switch popups to $lib/skeletonExtensions and add ESLint rule to warn …
Browse files Browse the repository at this point in the history
…about using the wrong one
  • Loading branch information
budak7273 committed Sep 15, 2024
1 parent ec3c272 commit 28db601
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
11 changes: 10 additions & 1 deletion frontend/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,15 @@ module.exports = {
'import/order': ['error', { 'newlines-between': 'always', alphabetize: { order: 'asc' } }],
'import/newline-after-import': ['error'],
'import/no-duplicates': ['error'],
'no-restricted-imports': ['error', { patterns: ['*/lib/*', '..*', '**/wailsjs/**/*'] }],
'no-restricted-imports': ['error', {
patterns: [
{ group: ['*/lib/*'] },
{ group: ['..*'], message: 'No relative imports' },
{ group: ['**/wailsjs/**/*'], message: 'Use $wailsjs/runtime instead' },
],
paths: [
{ name: '@skeletonlabs/skeleton', importNames: ['popup', 'PopupSettings'], message: 'Use $lib/skeletonExtensions instead to properly handle hover popups.' },
],
}],
},
};
3 changes: 1 addition & 2 deletions frontend/src/lib/components/left-bar/LeftBar.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<script lang="ts">
import { mdiAlert, mdiCheckCircle, mdiCloseCircle, mdiDownload, mdiFolderOpen, mdiHelp, mdiHelpCircle, mdiLoading, mdiMonitor, mdiPencil, mdiPlusCircle, mdiServer, mdiServerNetwork, mdiTrashCan, mdiUpload, mdiWeb } from '@mdi/js';
import { type PopupSettings, popup } from '@skeletonlabs/skeleton';
import _ from 'lodash';
import { siDiscord, siGithub } from 'simple-icons/icons';
Expand All @@ -14,7 +13,7 @@
import Tooltip from '$lib/components/Tooltip.svelte';
import DeleteProfile from '$lib/components/modals/profiles/DeleteProfile.svelte';
import RenameProfile from '$lib/components/modals/profiles/RenameProfile.svelte';
import { getModalStore } from '$lib/skeletonExtensions';
import { type PopupSettings, getModalStore, popup } from '$lib/skeletonExtensions';
import { queuedMods } from '$lib/store/actionQueue';
import { canChangeInstall, canModify, installs, installsMetadata, modsEnabled, profiles, selectedInstall, selectedProfile } from '$lib/store/ficsitCLIStore';
import { error, siteURL } from '$lib/store/generalStore';
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/lib/components/modals/ErrorDetails.svelte
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<script lang="ts">
import { type PopupSettings, popup } from '@skeletonlabs/skeleton';
import { getTranslate } from '@tolgee/svelte';
import T from '$lib/components/T.svelte';
import Tooltip from '$lib/components/Tooltip.svelte';
import { type PopupSettings, popup } from '$lib/skeletonExtensions';
import { GenerateDebugInfo } from '$wailsjs/go/app/app';
import { BrowserOpenURL, LogError } from '$wailsjs/runtime/runtime';
import { BrowserOpenURL } from '$wailsjs/runtime/runtime';
export let onClose: (() => void) | null = null;
Expand Down

0 comments on commit 28db601

Please sign in to comment.