Skip to content

Commit abe88f0

Browse files
committed
chore: lint pass (app-frontend)
1 parent c1b435c commit abe88f0

File tree

90 files changed

+448
-465
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+448
-465
lines changed

apps/app-frontend/eslint.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
import config from '@modrinth/tooling-config/eslint/nuxt.mjs'
2-
export default config
2+
export default config

apps/app-frontend/package.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,22 +42,18 @@
4242
},
4343
"devDependencies": {
4444
"@modrinth/tooling-config": "workspace:*",
45-
"@eslint/compat": "^1.1.1",
4645
"@formatjs/cli": "^6.2.12",
47-
"@nuxt/eslint-config": "^0.5.6",
4846
"@taijased/vue-render-tracker": "^1.0.7",
4947
"@vitejs/plugin-vue": "^5.0.4",
5048
"autoprefixer": "^10.4.19",
51-
"eslint": "^9.9.1",
52-
"eslint-plugin-turbo": "^2.5.4",
5349
"postcss": "^8.4.39",
54-
"prettier": "^3.2.5",
5550
"sass": "^1.74.1",
5651
"tailwindcss": "^3.4.4",
5752
"typescript": "^5.5.4",
5853
"vite": "^5.4.6",
5954
"vue-tsc": "^2.1.6"
6055
},
6156
"packageManager": "[email protected]",
62-
"web-types": "../../web-types.json"
57+
"web-types": "../../web-types.json",
58+
"prettier": "@modrinth/tooling-config/prettier.nuxt.config.js"
6359
}

apps/app-frontend/src/App.vue

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ function handleAuxClick(e) {
428428
<InstanceCreationModal ref="installationModal" />
429429
</Suspense>
430430
<div
431-
class="app-grid-navbar bg-bg-raised flex flex-col p-[0.5rem] pt-0 gap-[0.5rem] w-[--left-bar-width]"
431+
class="app-grid-navbar flex w-[--left-bar-width] flex-col gap-[0.5rem] bg-bg-raised p-[0.5rem] pt-0"
432432
>
433433
<NavButton v-tooltip.right="'Home'" to="/">
434434
<HomeIcon />
@@ -459,7 +459,7 @@ function handleAuxClick(e) {
459459
>
460460
<LibraryIcon />
461461
</NavButton>
462-
<div class="h-px w-6 mx-auto my-2 bg-button-bg"></div>
462+
<div class="mx-auto my-2 h-px w-6 bg-button-bg"></div>
463463
<suspense>
464464
<QuickInstanceSwitcher />
465465
</suspense>
@@ -502,26 +502,26 @@ function handleAuxClick(e) {
502502
<template #label>Sign in</template>
503503
</NavButton>
504504
</div>
505-
<div data-tauri-drag-region class="app-grid-statusbar bg-bg-raised h-[--top-bar-height] flex">
505+
<div data-tauri-drag-region class="app-grid-statusbar flex h-[--top-bar-height] bg-bg-raised">
506506
<div data-tauri-drag-region class="flex p-3">
507-
<ModrinthAppLogo class="h-full w-auto text-contrast pointer-events-none" />
508-
<div class="flex items-center gap-1 ml-3">
507+
<ModrinthAppLogo class="pointer-events-none h-full w-auto text-contrast" />
508+
<div class="ml-3 flex items-center gap-1">
509509
<button
510-
class="cursor-pointer p-0 m-0 text-contrast border-none outline-none bg-button-bg rounded-full flex items-center justify-center w-6 h-6 hover:brightness-75 transition-all"
510+
class="m-0 flex h-6 w-6 cursor-pointer items-center justify-center rounded-full border-none bg-button-bg p-0 text-contrast outline-none transition-all hover:brightness-75"
511511
@click="router.back()"
512512
>
513513
<LeftArrowIcon />
514514
</button>
515515
<button
516-
class="cursor-pointer p-0 m-0 text-contrast border-none outline-none bg-button-bg rounded-full flex items-center justify-center w-6 h-6 hover:brightness-75 transition-all"
516+
class="m-0 flex h-6 w-6 cursor-pointer items-center justify-center rounded-full border-none bg-button-bg p-0 text-contrast outline-none transition-all hover:brightness-75"
517517
@click="router.forward()"
518518
>
519519
<RightArrowIcon />
520520
</button>
521521
</div>
522522
<Breadcrumbs class="pt-[2px]" />
523523
</div>
524-
<section class="flex ml-auto items-center">
524+
<section class="ml-auto flex items-center">
525525
<ButtonStyled
526526
v-if="!forceSidebar && themeStore.toggleSidebar"
527527
:type="sidebarToggled ? 'standard' : 'transparent'"
@@ -535,7 +535,7 @@ function handleAuxClick(e) {
535535
<RightArrowIcon />
536536
</button>
537537
</ButtonStyled>
538-
<div class="flex mr-3">
538+
<div class="mr-3 flex">
539539
<Suspense>
540540
<RunningAppBar />
541541
</Suspense>
@@ -564,9 +564,9 @@ function handleAuxClick(e) {
564564
class="app-contents experimental-styles-within"
565565
:class="{ 'sidebar-enabled': sidebarVisible }"
566566
>
567-
<div class="app-viewport flex-grow router-view">
567+
<div class="app-viewport router-view flex-grow">
568568
<div
569-
class="loading-indicator-container h-8 fixed z-50"
569+
class="loading-indicator-container fixed z-50 h-8"
570570
:style="{
571571
top: 'calc(var(--top-bar-height))',
572572
left: 'calc(var(--left-bar-width))',
@@ -577,20 +577,20 @@ function handleAuxClick(e) {
577577
</div>
578578
<div
579579
v-if="themeStore.featureFlags.page_path"
580-
class="absolute bottom-0 left-0 m-2 bg-tooltip-bg text-tooltip-text font-semibold rounded-full px-2 py-1 text-xs z-50"
580+
class="absolute bottom-0 left-0 z-50 m-2 rounded-full bg-tooltip-bg px-2 py-1 text-xs font-semibold text-tooltip-text"
581581
>
582582
{{ route.fullPath }}
583583
</div>
584584
<div
585585
id="background-teleport-target"
586-
class="absolute h-full -z-10 rounded-tl-[--radius-xl] overflow-hidden"
586+
class="absolute -z-10 h-full overflow-hidden rounded-tl-[--radius-xl]"
587587
:style="{
588588
width: 'calc(100% - var(--right-bar-width))',
589589
}"
590590
></div>
591591
<div
592592
v-if="criticalErrorMessage"
593-
class="m-6 mb-0 flex flex-col border-red bg-bg-red rounded-2xl border-2 border-solid p-4 gap-1 font-semibold text-contrast"
593+
class="m-6 mb-0 flex flex-col gap-1 rounded-2xl border-2 border-solid border-red bg-bg-red p-4 font-semibold text-contrast"
594594
>
595595
<h1 class="m-0 text-lg font-extrabold">{{ criticalErrorMessage.header }}</h1>
596596
<div
@@ -607,29 +607,29 @@ function handleAuxClick(e) {
607607
</RouterView>
608608
</div>
609609
<div
610-
class="app-sidebar mt-px shrink-0 flex flex-col border-0 border-l-[1px] border-[--brand-gradient-border] border-solid overflow-auto"
610+
class="app-sidebar mt-px flex shrink-0 flex-col overflow-auto border-0 border-l-[1px] border-solid border-[--brand-gradient-border]"
611611
:class="{ 'has-plus': hasPlus }"
612612
>
613613
<div
614-
class="app-sidebar-scrollable flex-grow shrink overflow-y-auto relative"
614+
class="app-sidebar-scrollable relative shrink flex-grow overflow-y-auto"
615615
:class="{ 'pb-12': !hasPlus }"
616616
>
617617
<div id="sidebar-teleport-target" class="sidebar-teleport-content"></div>
618618
<div class="sidebar-default-content" :class="{ 'sidebar-enabled': sidebarVisible }">
619-
<div class="p-4 border-0 border-b-[1px] border-[--brand-gradient-border] border-solid">
620-
<h3 class="text-lg m-0">Playing as</h3>
619+
<div class="border-0 border-b-[1px] border-solid border-[--brand-gradient-border] p-4">
620+
<h3 class="m-0 text-lg">Playing as</h3>
621621
<suspense>
622622
<AccountsCard ref="accounts" mode="small" />
623623
</suspense>
624624
</div>
625-
<div class="p-4 border-0 border-b-[1px] border-[--brand-gradient-border] border-solid">
625+
<div class="border-0 border-b-[1px] border-solid border-[--brand-gradient-border] p-4">
626626
<suspense>
627627
<FriendsList :credentials="credentials" :sign-in="() => signIn()" />
628628
</suspense>
629629
</div>
630-
<div v-if="news && news.length > 0" class="pt-4 flex flex-col items-center">
631-
<h3 class="px-4 text-lg m-0 text-left w-full">News</h3>
632-
<div class="px-4 pt-2 space-y-4 flex flex-col items-center w-full">
630+
<div v-if="news && news.length > 0" class="flex flex-col items-center pt-4">
631+
<h3 class="m-0 w-full px-4 text-left text-lg">News</h3>
632+
<div class="flex w-full flex-col items-center space-y-4 px-4 pt-2">
633633
<NewsArticleCard
634634
v-for="(item, index) in news"
635635
:key="`news-${index}`"
@@ -647,7 +647,7 @@ function handleAuxClick(e) {
647647
<template v-if="showAd">
648648
<a
649649
href="https://modrinth.plus?app"
650-
class="absolute bottom-[250px] w-full flex justify-center items-center gap-1 px-4 py-3 text-purple font-medium hover:underline z-10"
650+
class="absolute bottom-[250px] z-10 flex w-full items-center justify-center gap-1 px-4 py-3 font-medium text-purple hover:underline"
651651
target="_blank"
652652
>
653653
<ArrowBigUpDashIcon class="text-2xl" /> Upgrade to Modrinth+

apps/app-frontend/src/components/ui/AccountsCard.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div
33
v-if="mode !== 'isolated'"
44
ref="button"
5-
class="button-base mt-2 px-3 py-2 bg-button-bg rounded-xl flex items-center gap-2"
5+
class="button-base mt-2 flex items-center gap-2 rounded-xl bg-button-bg px-3 py-2"
66
:class="{ expanded: mode === 'expanded' }"
77
@click="toggleMenu"
88
>
@@ -12,11 +12,11 @@
1212
selectedAccount ? avatarUrl : 'https://launcher-files.modrinth.com/assets/steve_head.png'
1313
"
1414
/>
15-
<div class="flex flex-col w-full">
15+
<div class="flex w-full flex-col">
1616
<span>{{ selectedAccount ? selectedAccount.profile.name : 'Select account' }}</span>
17-
<span class="text-secondary text-xs">Minecraft account</span>
17+
<span class="text-xs text-secondary">Minecraft account</span>
1818
</div>
19-
<DropdownIcon class="w-5 h-5 shrink-0" />
19+
<DropdownIcon class="h-5 w-5 shrink-0" />
2020
</div>
2121
<transition name="fade">
2222
<Card

apps/app-frontend/src/components/ui/Breadcrumbs.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@
2929
<span
3030
v-else
3131
data-tauri-drag-region
32-
class="text-contrast font-semibold cursor-default select-none"
32+
class="cursor-default select-none font-semibold text-contrast"
3333
>{{
3434
breadcrumb.name.charAt(0) === '?'
3535
? breadcrumbData.getName(breadcrumb.name.slice(1))
3636
: breadcrumb.name
3737
}}</span
3838
>
39-
<ChevronRightIcon v-if="breadcrumb.link" data-tauri-drag-region class="w-5 h-5" />
39+
<ChevronRightIcon v-if="breadcrumb.link" data-tauri-drag-region class="h-5 w-5" />
4040
</template>
4141
</div>
4242
</template>

apps/app-frontend/src/components/ui/ErrorModal.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,19 +301,19 @@ async function copyToClipboard(text) {
301301
</ButtonStyled>
302302
</div>
303303
<template v-if="hasDebugInfo">
304-
<div class="bg-button-bg rounded-xl mt-2 overflow-clip">
304+
<div class="mt-2 overflow-clip rounded-xl bg-button-bg">
305305
<button
306-
class="flex items-center justify-between w-full bg-transparent border-0 px-4 py-3 cursor-pointer"
306+
class="flex w-full cursor-pointer items-center justify-between border-0 bg-transparent px-4 py-3"
307307
@click="errorCollapsed = !errorCollapsed"
308308
>
309-
<span class="text-contrast font-extrabold m-0">Debug information:</span>
309+
<span class="m-0 font-extrabold text-contrast">Debug information:</span>
310310
<DropdownIcon
311311
class="h-5 w-5 text-secondary transition-transform"
312312
:class="{ 'rotate-180': !errorCollapsed }"
313313
/>
314314
</button>
315315
<Collapsible :collapsed="errorCollapsed">
316-
<pre class="m-0 px-4 py-3 bg-bg rounded-none">{{ debugInfo }}</pre>
316+
<pre class="m-0 rounded-none bg-bg px-4 py-3">{{ debugInfo }}</pre>
317317
</Collapsible>
318318
</div>
319319
</template>

apps/app-frontend/src/components/ui/ExportModal.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ const exportPack = async () => {
138138

139139
<div class="table">
140140
<div class="table-head">
141-
<div class="table-cell row-wise">
141+
<div class="row-wise table-cell">
142142
Select files and folders to include in pack
143143
<Button
144144
class="sleek-primary collapsed-button"
@@ -152,7 +152,7 @@ const exportPack = async () => {
152152
</div>
153153
<div v-if="showingFiles" class="table-content">
154154
<div v-for="[path, children] in folders" :key="path.name" class="table-row">
155-
<div class="table-cell file-entry">
155+
<div class="file-entry table-cell">
156156
<div class="file-primary">
157157
<Checkbox
158158
:model-value="children.every((child) => child.selected)"
@@ -182,7 +182,7 @@ const exportPack = async () => {
182182
</div>
183183
</div>
184184
<div v-for="file in files" :key="file.path" class="table-row">
185-
<div class="table-cell file-entry">
185+
<div class="file-entry table-cell">
186186
<div class="file-primary">
187187
<Checkbox
188188
v-model="file.selected"

apps/app-frontend/src/components/ui/Instance.vue

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ onUnmounted(() => unlisten())
134134
<template>
135135
<template v-if="compact">
136136
<div
137-
class="card-shadow grid grid-cols-[auto_1fr_auto] bg-bg-raised rounded-xl p-3 pl-4 gap-2 cursor-pointer hover:brightness-90 transition-all"
137+
class="card-shadow grid cursor-pointer grid-cols-[auto_1fr_auto] gap-2 rounded-xl bg-bg-raised p-3 pl-4 transition-all hover:brightness-90"
138138
@click="seeInstance"
139139
@mouseenter="checkProcess"
140140
>
@@ -144,7 +144,7 @@ onUnmounted(() => unlisten())
144144
:tint-by="instance.path"
145145
alt="Mod card"
146146
/>
147-
<div class="h-full flex items-center font-bold text-contrast leading-normal">
147+
<div class="flex h-full items-center font-bold leading-normal text-contrast">
148148
<span class="line-clamp-2">{{ instance.name }}</span>
149149
</div>
150150
<div class="flex items-center">
@@ -169,7 +169,7 @@ onUnmounted(() => unlisten())
169169
</button>
170170
</ButtonStyled>
171171
</div>
172-
<div class="flex items-center col-span-3 gap-1 text-secondary font-semibold">
172+
<div class="col-span-3 flex items-center gap-1 font-semibold text-secondary">
173173
<TimerIcon />
174174
<span class="text-sm">
175175
<template v-if="instance.last_played">
@@ -182,7 +182,7 @@ onUnmounted(() => unlisten())
182182
</template>
183183
<div v-else>
184184
<div
185-
class="button-base bg-bg-raised p-4 rounded-xl flex gap-3 group"
185+
class="button-base group flex gap-3 rounded-xl bg-bg-raised p-4"
186186
@click="seeInstance"
187187
@mouseenter="checkProcess"
188188
>
@@ -192,14 +192,14 @@ onUnmounted(() => unlisten())
192192
:src="instance.icon_path ? convertFileSrc(instance.icon_path) : null"
193193
:tint-by="instance.path"
194194
alt="Mod card"
195-
:class="`transition-all ${modLoading || installing ? `brightness-[0.25] scale-[0.85]` : `group-hover:brightness-75`}`"
195+
:class="`transition-all ${modLoading || installing ? `scale-[0.85] brightness-[0.25]` : `group-hover:brightness-75`}`"
196196
/>
197197
<div class="absolute inset-0 flex items-center justify-center">
198198
<ButtonStyled v-if="playing" size="large" color="red" circular>
199199
<button
200200
v-tooltip="'Stop'"
201201
:class="{ 'scale-100 opacity-100': playing }"
202-
class="transition-all scale-75 origin-bottom opacity-0 card-shadow"
202+
class="card-shadow origin-bottom scale-75 opacity-0 transition-all"
203203
@click="(e) => stop(e, 'InstanceCard')"
204204
@mousehover="checkProcess"
205205
>
@@ -209,13 +209,13 @@ onUnmounted(() => unlisten())
209209
<SpinnerIcon
210210
v-else-if="modLoading || installing"
211211
v-tooltip="modLoading ? 'Instance is loading...' : 'Installing...'"
212-
class="animate-spin w-8 h-8"
212+
class="h-8 w-8 animate-spin"
213213
tabindex="-1"
214214
/>
215215
<ButtonStyled v-else-if="!installed" size="large" color="brand" circular>
216216
<button
217217
v-tooltip="'Repair'"
218-
class="transition-all scale-75 group-hover:scale-100 group-focus-within:scale-100 origin-bottom opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 card-shadow"
218+
class="card-shadow origin-bottom scale-75 opacity-0 transition-all group-focus-within:scale-100 group-focus-within:opacity-100 group-hover:scale-100 group-hover:opacity-100"
219219
@click="(e) => repair(e)"
220220
>
221221
<DownloadIcon />
@@ -224,7 +224,7 @@ onUnmounted(() => unlisten())
224224
<ButtonStyled v-else size="large" color="brand" circular>
225225
<button
226226
v-tooltip="'Play'"
227-
class="transition-all scale-75 group-hover:scale-100 group-focus-within:scale-100 origin-bottom opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 card-shadow"
227+
class="card-shadow origin-bottom scale-75 opacity-0 transition-all group-focus-within:scale-100 group-focus-within:opacity-100 group-hover:scale-100 group-hover:opacity-100"
228228
@click="(e) => play(e, 'InstanceCard')"
229229
@mousehover="checkProcess"
230230
>
@@ -234,10 +234,10 @@ onUnmounted(() => unlisten())
234234
</div>
235235
</div>
236236
<div class="flex flex-col gap-1">
237-
<p class="m-0 text-md font-bold text-contrast leading-tight line-clamp-1">
237+
<p class="text-md m-0 line-clamp-1 font-bold leading-tight text-contrast">
238238
{{ instance.name }}
239239
</p>
240-
<div class="flex items-center col-span-3 gap-1 text-secondary font-semibold mt-auto">
240+
<div class="col-span-3 mt-auto flex items-center gap-1 font-semibold text-secondary">
241241
<GameIcon class="shrink-0" />
242242
<span class="text-sm capitalize">
243243
{{ instance.loader }} {{ instance.game_version }}

apps/app-frontend/src/components/ui/InstanceIndicator.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ defineProps<{
1919
</script>
2020

2121
<template>
22-
<div class="flex justify-between items-center border-0 border-b border-solid border-divider pb-4">
22+
<div class="flex items-center justify-between border-0 border-b border-solid border-divider pb-4">
2323
<router-link
2424
:to="`/instance/${encodeURIComponent(instance.path)}`"
2525
tabindex="-1"
@@ -32,10 +32,10 @@ defineProps<{
3232
size="48px"
3333
/>
3434
<span class="flex flex-col gap-2">
35-
<span class="font-extrabold bold text-contrast">
35+
<span class="bold font-extrabold text-contrast">
3636
{{ instance.name }}
3737
</span>
38-
<span class="text-secondary flex items-center gap-2 font-semibold">
38+
<span class="flex items-center gap-2 font-semibold text-secondary">
3939
<GameIcon class="h-5 w-5 text-secondary" />
4040
{{ formatCategory(instance.loader) }} {{ instance.game_version }}
4141
</span>

0 commit comments

Comments
 (0)