Skip to content

Commit

Permalink
Lint frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
mircearoata committed Dec 10, 2023
1 parent 19bd9af commit ac85e35
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 22 deletions.
10 changes: 6 additions & 4 deletions frontend/src/lib/components/ResponsiveButton.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<script lang="ts">
import Button from "@smui/button";
import Tooltip, { Wrapper } from "@smui/tooltip";
import SvgIcon from "./SVGIcon.svelte";
import type { ButtonDisplay } from "$lib/utils/responsiveButton";
import Button from '@smui/button';
import Tooltip, { Wrapper } from '@smui/tooltip';
import SvgIcon from './SVGIcon.svelte';
import type { ButtonDisplay } from '$lib/utils/responsiveButton';
export let display: ButtonDisplay;
export let onClickAction: () => void;
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/lib/components/mod-details/ModDetails.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@
}
$: authorClick = () => {
$search = `author:"${author}"`
}
$search = `author:"${author}"`;
};
// Does not need offline support, since descriptions are disabled in offline mode
function handleElementClick(element: HTMLElement) {
Expand Down Expand Up @@ -411,8 +411,8 @@
{:else if descriptionRendered}
<!-- Intercepting mouse clicks for the link interrupter also seems to work for pressing Enter on the keyboard without a specific key handler added -->
<!-- svelte-ignore a11y-no-noninteractive-element-interactions a11y-click-events-have-key-events -->
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
<p on:click={handleDescriptionClick} role="article">
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
{@html descriptionRendered}
</p>
{:else}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lib/components/mods-list/ModsList.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { getContextClient } from '@urql/svelte';
import _ from 'lodash';
import Fuse from 'fuse.js';
import { createEventDispatcher } from 'svelte';
import AnnouncementsBar from '../announcements/AnnouncementsBar.svelte';
Expand All @@ -16,7 +17,6 @@
import { offline, startView } from '$lib/store/settingsStore';
import { expandedMod } from '$lib/store/generalStore';
import { OfflineGetMods } from '$wailsjs/go/ficsitcli/FicsitCLI';
import { createEventDispatcher } from 'svelte';
const dispatch = createEventDispatcher();
Expand Down
25 changes: 12 additions & 13 deletions frontend/src/lib/components/mods-list/ModsListItem.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<script lang="ts">
import { mdiDownload, mdiEye, mdiStar, mdiPlay, mdiPause, mdiTrashCan, mdiTrayFull, mdiTrayMinus, mdiSync, mdiLinkLock, mdiArchiveCheck, mdiPauseCircle, mdiPlayCircle, mdiStarMinus, mdiStarPlus, mdiStarOutline, mdiTagMultiple } from '@mdi/js';
import { createEventDispatcher } from 'svelte';
import Button from '@smui/button';
import LinearProgress from '@smui/linear-progress';
import Tooltip, { Wrapper } from '@smui/tooltip';
import { getContextClient } from '@urql/svelte';
Expand All @@ -19,7 +18,7 @@
import { CompatibilityState } from '$lib/generated';
import { markdown } from '$lib/utils/markdown';
import type { ButtonDisplay } from '$lib/utils/responsiveButton';
import ResponsiveButton from '../ResponsiveButton.svelte';
import ResponsiveButton from '$lib/components/ResponsiveButton.svelte';
export let mod: PartialMod;
Expand All @@ -32,8 +31,8 @@
}
$: authorClick = () => {
$search = `author:"${author}"`
}
$search = `author:"${author}"`;
};
export let selected: boolean;
Expand Down Expand Up @@ -70,15 +69,15 @@
iconHover: mdiTrayMinus,
tooltip: isInstalled ?
'This mod is queued to be uninstalled. Click to cancel the operation.' :
'This mod is queued to be installed. Click to cancel the operation.',
'This mod is queued to be installed. Click to cancel the operation.',
};
}
let display: ButtonDisplay = {
icon: mdiDownload,
iconHover: mdiDownload,
tooltip: 'Click to install this mod.',
}
};
if (isInstalled) {
display = {
icon: mdiArchiveCheck,
Expand All @@ -87,9 +86,9 @@
};
} else if (compatibility.state !== CompatibilityState.Works) {
if (installButtonDisabled) {
display.tooltip = `You can't install this mod. Reason:`;
display.tooltip = 'You can\'t install this mod. Reason:';
} else {
display.tooltip = `There are problems reported with this mod, but you can try to install it anyways. Details:`;
display.tooltip = 'There are problems reported with this mod, but you can try to install it anyways. Details:';
}
if (compatibility.note) {
display.tooltipHtml = '<br/>' + compatibility.note;
Expand All @@ -99,7 +98,7 @@
}
}
if (queued) {
display.tooltip = "This mod is already queued for another operation.";
display.tooltip = 'This mod is already queued for another operation.';
delete display.tooltipHtml;
}
return display;
Expand All @@ -112,7 +111,7 @@
iconHover: mdiTrayMinus,
tooltip: isEnabled ?
'This mod is queued to be Paused. Click to cancel the operation.' :
'This mod is queued to be Resumed. Click to cancel the operation.',
'This mod is queued to be Resumed. Click to cancel the operation.',
};
}
Expand All @@ -129,7 +128,7 @@
};
}
if (queued) {
display.tooltip = "This mod is already queued for another operation.";
display.tooltip = 'This mod is already queued for another operation.';
}
return display;
})();
Expand All @@ -152,7 +151,7 @@
icon: mdiStarOutline,
iconHover: mdiStarPlus,
tooltip: 'Click to add this mod to your Favorites.',
tooltipHtml: "Having a mod Favorited is unrelated to whether or not it's installed - it's a way to keep track of a mod for later regardless of what Profile you have selected."
tooltipHtml: 'Having a mod Favorited is unrelated to whether or not it\'s installed - it\'s a way to keep track of a mod for later regardless of what Profile you have selected.',
};
})();
Expand Down Expand Up @@ -314,7 +313,7 @@
</div>
</div>
<!-- The purpose of the event handlers here are to prevent navigating to the mod's page when clicking on one of the sub-buttons of the div. Thus, it shouldn't be focusable despite having "interactions" -->
<!-- svelte-ignore a11y-no-noninteractive-element-interactions a11y-click-events-have-key-events -->
<!-- svelte-ignore a11y-no-noninteractive-element-interactions -->
<div class="pr-2 flex h-full items-center" role="separator" tabindex="-1" on:click|stopPropagation={() => { /* empty */ }} on:keypress|stopPropagation={() => { /* empty */ }}>
<ResponsiveButton
display={enableButtonDisplay}
Expand Down
2 changes: 1 addition & 1 deletion frontend/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
]
},
},
"include": ["src/**/*.ts", "src/**/*.js", "src/**/*.svelte"],
"include": ["src/**/*.ts", "src/**/*.js", "src/**/*.svelte", "*.ts"],
"exclude": ["src/lib/generated/wailsjs/**/*"]
}

0 comments on commit ac85e35

Please sign in to comment.