Skip to content

Commit ac85e35

Browse files
committed
Lint frontend
1 parent 19bd9af commit ac85e35

File tree

5 files changed

+23
-22
lines changed

5 files changed

+23
-22
lines changed

frontend/src/lib/components/ResponsiveButton.svelte

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
<script lang="ts">
2-
import Button from "@smui/button";
3-
import Tooltip, { Wrapper } from "@smui/tooltip";
4-
import SvgIcon from "./SVGIcon.svelte";
5-
import type { ButtonDisplay } from "$lib/utils/responsiveButton";
2+
import Button from '@smui/button';
3+
import Tooltip, { Wrapper } from '@smui/tooltip';
4+
5+
import SvgIcon from './SVGIcon.svelte';
6+
7+
import type { ButtonDisplay } from '$lib/utils/responsiveButton';
68
79
export let display: ButtonDisplay;
810
export let onClickAction: () => void;

frontend/src/lib/components/mod-details/ModDetails.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,8 @@
185185
}
186186
187187
$: authorClick = () => {
188-
$search = `author:"${author}"`
189-
}
188+
$search = `author:"${author}"`;
189+
};
190190
191191
// Does not need offline support, since descriptions are disabled in offline mode
192192
function handleElementClick(element: HTMLElement) {
@@ -411,8 +411,8 @@
411411
{:else if descriptionRendered}
412412
<!-- Intercepting mouse clicks for the link interrupter also seems to work for pressing Enter on the keyboard without a specific key handler added -->
413413
<!-- svelte-ignore a11y-no-noninteractive-element-interactions a11y-click-events-have-key-events -->
414-
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
415414
<p on:click={handleDescriptionClick} role="article">
415+
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
416416
{@html descriptionRendered}
417417
</p>
418418
{:else}

frontend/src/lib/components/mods-list/ModsList.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import { getContextClient } from '@urql/svelte';
33
import _ from 'lodash';
44
import Fuse from 'fuse.js';
5+
import { createEventDispatcher } from 'svelte';
56
67
import AnnouncementsBar from '../announcements/AnnouncementsBar.svelte';
78
@@ -16,7 +17,6 @@
1617
import { offline, startView } from '$lib/store/settingsStore';
1718
import { expandedMod } from '$lib/store/generalStore';
1819
import { OfflineGetMods } from '$wailsjs/go/ficsitcli/FicsitCLI';
19-
import { createEventDispatcher } from 'svelte';
2020
2121
const dispatch = createEventDispatcher();
2222

frontend/src/lib/components/mods-list/ModsListItem.svelte

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<script lang="ts">
22
import { mdiDownload, mdiEye, mdiStar, mdiPlay, mdiPause, mdiTrashCan, mdiTrayFull, mdiTrayMinus, mdiSync, mdiLinkLock, mdiArchiveCheck, mdiPauseCircle, mdiPlayCircle, mdiStarMinus, mdiStarPlus, mdiStarOutline, mdiTagMultiple } from '@mdi/js';
33
import { createEventDispatcher } from 'svelte';
4-
import Button from '@smui/button';
54
import LinearProgress from '@smui/linear-progress';
65
import Tooltip, { Wrapper } from '@smui/tooltip';
76
import { getContextClient } from '@urql/svelte';
@@ -19,7 +18,7 @@
1918
import { CompatibilityState } from '$lib/generated';
2019
import { markdown } from '$lib/utils/markdown';
2120
import type { ButtonDisplay } from '$lib/utils/responsiveButton';
22-
import ResponsiveButton from '../ResponsiveButton.svelte';
21+
import ResponsiveButton from '$lib/components/ResponsiveButton.svelte';
2322
2423
export let mod: PartialMod;
2524
@@ -32,8 +31,8 @@
3231
}
3332
3433
$: authorClick = () => {
35-
$search = `author:"${author}"`
36-
}
34+
$search = `author:"${author}"`;
35+
};
3736
3837
export let selected: boolean;
3938
@@ -70,15 +69,15 @@
7069
iconHover: mdiTrayMinus,
7170
tooltip: isInstalled ?
7271
'This mod is queued to be uninstalled. Click to cancel the operation.' :
73-
'This mod is queued to be installed. Click to cancel the operation.',
72+
'This mod is queued to be installed. Click to cancel the operation.',
7473
};
7574
}
7675
7776
let display: ButtonDisplay = {
7877
icon: mdiDownload,
7978
iconHover: mdiDownload,
8079
tooltip: 'Click to install this mod.',
81-
}
80+
};
8281
if (isInstalled) {
8382
display = {
8483
icon: mdiArchiveCheck,
@@ -87,9 +86,9 @@
8786
};
8887
} else if (compatibility.state !== CompatibilityState.Works) {
8988
if (installButtonDisabled) {
90-
display.tooltip = `You can't install this mod. Reason:`;
89+
display.tooltip = 'You can\'t install this mod. Reason:';
9190
} else {
92-
display.tooltip = `There are problems reported with this mod, but you can try to install it anyways. Details:`;
91+
display.tooltip = 'There are problems reported with this mod, but you can try to install it anyways. Details:';
9392
}
9493
if (compatibility.note) {
9594
display.tooltipHtml = '<br/>' + compatibility.note;
@@ -99,7 +98,7 @@
9998
}
10099
}
101100
if (queued) {
102-
display.tooltip = "This mod is already queued for another operation.";
101+
display.tooltip = 'This mod is already queued for another operation.';
103102
delete display.tooltipHtml;
104103
}
105104
return display;
@@ -112,7 +111,7 @@
112111
iconHover: mdiTrayMinus,
113112
tooltip: isEnabled ?
114113
'This mod is queued to be Paused. Click to cancel the operation.' :
115-
'This mod is queued to be Resumed. Click to cancel the operation.',
114+
'This mod is queued to be Resumed. Click to cancel the operation.',
116115
};
117116
}
118117
@@ -129,7 +128,7 @@
129128
};
130129
}
131130
if (queued) {
132-
display.tooltip = "This mod is already queued for another operation.";
131+
display.tooltip = 'This mod is already queued for another operation.';
133132
}
134133
return display;
135134
})();
@@ -152,7 +151,7 @@
152151
icon: mdiStarOutline,
153152
iconHover: mdiStarPlus,
154153
tooltip: 'Click to add this mod to your Favorites.',
155-
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."
154+
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.',
156155
};
157156
})();
158157
@@ -314,7 +313,7 @@
314313
</div>
315314
</div>
316315
<!-- 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" -->
317-
<!-- svelte-ignore a11y-no-noninteractive-element-interactions a11y-click-events-have-key-events -->
316+
<!-- svelte-ignore a11y-no-noninteractive-element-interactions -->
318317
<div class="pr-2 flex h-full items-center" role="separator" tabindex="-1" on:click|stopPropagation={() => { /* empty */ }} on:keypress|stopPropagation={() => { /* empty */ }}>
319318
<ResponsiveButton
320319
display={enableButtonDisplay}

frontend/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@
2424
]
2525
},
2626
},
27-
"include": ["src/**/*.ts", "src/**/*.js", "src/**/*.svelte"],
27+
"include": ["src/**/*.ts", "src/**/*.js", "src/**/*.svelte", "*.ts"],
2828
"exclude": ["src/lib/generated/wailsjs/**/*"]
2929
}

0 commit comments

Comments
 (0)