Skip to content

Commit b610c1c

Browse files
authored
fix: eslint (#378)
* fix: eslint script closes #345 * format: eslint oneclient * fix eslint script again :pleading:
1 parent 6ef5e63 commit b610c1c

File tree

14 files changed

+93
-77
lines changed

14 files changed

+93
-77
lines changed

apps/oneclient/frontend/src/components/SkinViewer.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export function SkinViewer({
5050
enableZoom = true,
5151
enableRotate = true,
5252
enablePan = true,
53-
elytra = false
53+
elytra = false,
5454
}: SkinViewerProps) {
5555
const canvasRef = useRef<HTMLCanvasElement>(null);
5656
const viewerRef = useRef<skinviewer.SkinViewer | null>(null);
@@ -78,13 +78,12 @@ export function SkinViewer({
7878
viewer.controls.object.position.set(x, y, z);
7979
viewer.controls.object.lookAt(viewer.controls.target);
8080
};
81-
setAngle(playerRotatePhi, playerRotateTheta)
81+
setAngle(playerRotatePhi, playerRotateTheta);
8282

8383
viewer.playerWrapper.translateX(translateRotateX);
8484
viewer.playerWrapper.translateY(translateRotateY);
8585
viewer.playerWrapper.translateZ(translateRotateZ);
8686

87-
8887
viewer.animation = animation;
8988

9089
viewer.autoRotate = autoRotate;

apps/oneclient/frontend/src/components/overlay/RemoveAccountModal.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@ export function RemoveAccountModal({
1414
<Overlay.Dialog>
1515
<Overlay.Title>Are you sure?</Overlay.Title>
1616

17-
<p>Do you want to remove <span className='font-bold' color='primary'>{profile.username}</span> from you're accounts?</p>
17+
<p>
18+
Do you want to remove
19+
<span className="font-bold" color="primary">{profile.username}</span>
20+
{' '}
21+
from you're accounts?
22+
</p>
1823
<p>This cannot be undone</p>
1924

2025
<AccountRow profile={profile} />

apps/oneclient/frontend/src/components/overlay/RemoveSkinCapeModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Button } from '@onelauncher/common/components';
22
import { Overlay } from './Overlay';
33

4-
export function RemoveSkinCapeModal({ onPress }: { onPress: () => void; }) {
4+
export function RemoveSkinCapeModal({ onPress }: { onPress: () => void }) {
55
return (
66
<Overlay.Dialog>
77
<Overlay.Title>Are you sure?</Overlay.Title>

apps/oneclient/frontend/src/routes/app/accountSkin.tsx

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { Overlay } from '@/components/overlay/Overlay';
66
import { usePlayerProfile } from '@/hooks/usePlayerProfile';
77
import { bindings } from '@/main';
88
import { getSkinUrl } from '@/utils/minecraft';
9+
import { toast } from '@/utils/toast';
910
import { useCommandSuspense } from '@onelauncher/common';
1011
import { Button } from '@onelauncher/common/components';
1112
import { useQueryClient } from '@tanstack/react-query';
@@ -17,7 +18,6 @@ import { Download01Icon, PlusIcon, Trash01Icon } from '@untitled-theme/icons-rea
1718
import { useEffect, useState } from 'react';
1819
import { DialogTrigger } from 'react-aria-components';
1920
import { CrouchAnimation, FlyingAnimation, HitAnimation, IdleAnimation, WalkingAnimation } from 'skinview3d';
20-
import { toast } from '@/utils/toast';
2121

2222
interface Skin {
2323
is_slim: boolean;
@@ -113,7 +113,7 @@ function RouteComponent() {
113113

114114
fetchSkins();
115115

116-
setCapes([{ url: "", id: "" }, ...loggedInUser.capes.map(cape => ({ url: cape.url, id: cape.id }))]);
116+
setCapes([{ url: '', id: '' }, ...loggedInUser.capes.map(cape => ({ url: cape.url, id: cape.id }))]);
117117
}, [loggedInUser]);
118118
const { data: profile } = usePlayerProfile(currentAccount?.id);
119119
const [animation, setAnimation] = useState<PlayerAnimation>(animations[0].animation);
@@ -145,22 +145,22 @@ function RouteComponent() {
145145
title: 'Import Skin',
146146
message: `Importing skin from ${username}`,
147147
});
148-
const { id } = await bindings.core.convertUsernameUUID(username) ?? { id: '', username: '' }
148+
const { id } = await bindings.core.convertUsernameUUID(username);
149149
if (id === '')
150150
return toast({
151151
type: 'error',
152152
title: 'Import Skin',
153153
message: `${username} doesn't exist`,
154154
});
155-
const playerProfile = await bindings.core.fetchMinecraftProfile(id)
155+
const playerProfile = await bindings.core.fetchMinecraftProfile(id);
156156
if (playerProfile.skin_url)
157157
setSkins([...skins, { is_slim: playerProfile.is_slim, skin_url: playerProfile.skin_url }]);
158158
toast({
159159
type: 'success',
160160
title: 'Import Skin',
161161
message: `Imported skin from ${username}`,
162162
});
163-
}
163+
};
164164

165165
const [shouldShowElytra, setShouldShowElytra] = useState<boolean>(false);
166166

@@ -170,11 +170,13 @@ function RouteComponent() {
170170
return;
171171
await bindings.core.changeSkin(currentAccount.access_token, selectedSkin.skin_url, selectedSkin.is_slim ? 'slim' : 'classic');
172172
if (selectedCape === '') {
173-
await bindings.core.removeCape(currentAccount.access_token)
174-
} else {
175-
const capeData = capes.find((cape) => cape.url === selectedCape)
176-
if (!capeData) return
177-
await bindings.core.changeCape(currentAccount.access_token, capeData.id)
173+
await bindings.core.removeCape(currentAccount.access_token);
174+
}
175+
else {
176+
const capeData = capes.find(cape => cape.url === selectedCape);
177+
if (!capeData)
178+
return;
179+
await bindings.core.changeCape(currentAccount.access_token, capeData.id);
178180
}
179181
queryClient.invalidateQueries({
180182
queryKey: ['getDefaultUser'],
@@ -363,16 +365,16 @@ function RenderSkin({ skin, selected, animation, setSelectedSkin, setSkins, cape
363365
{selected.skin_url === skin.skin_url
364366
? <></>
365367
: (
366-
<DialogTrigger>
367-
<Button className="group w-8 h-8 absolute top-0 right-0" color="ghost" size="icon">
368-
<Trash01Icon className="group-hover:stroke-danger" />
369-
</Button>
370-
371-
<Overlay>
372-
<RemoveSkinCapeModal onPress={() => setSkins(prev => prev.filter(skinData => skinData.skin_url !== skin.skin_url))} />
373-
</Overlay>
374-
</DialogTrigger>
375-
)}
368+
<DialogTrigger>
369+
<Button className="group w-8 h-8 absolute top-0 right-0" color="ghost" size="icon">
370+
<Trash01Icon className="group-hover:stroke-danger" />
371+
</Button>
372+
373+
<Overlay>
374+
<RemoveSkinCapeModal onPress={() => setSkins(prev => prev.filter(skinData => skinData.skin_url !== skin.skin_url))} />
375+
</Overlay>
376+
</DialogTrigger>
377+
)}
376378
<Button
377379
className="group w-8 h-8 absolute bottom-0 right-0"
378380
color="ghost"

apps/oneclient/frontend/src/routes/app/settings/developer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import Sidebar from './route';
66

77
export const Route = createFileRoute('/app/settings/developer')({
88
component: RouteComponent,
9-
})
9+
});
1010

1111
function RouteComponent() {
1212
return (

apps/oneclient/frontend/src/routes/onboarding/account.tsx

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -70,30 +70,32 @@ function RouteComponent() {
7070
<h1 className="text-4xl font-semibold mb-2">Account</h1>
7171
<p className="text-slate-400 text-lg mb-2">Before you continue, we require you to own a copy of Minecraft: Java Edition.</p>
7272
</div>
73-
{currentAccount ?
74-
<>
75-
<AccountPreview profile={currentAccount} />
76-
</>
77-
:
78-
<>
79-
{profile
80-
? (
81-
<>
82-
<AccountPreview profile={profile} />
83-
</>
84-
)
85-
: (
86-
<Button
87-
color="primary"
88-
isPending={isPending}
89-
onClick={onClick}
90-
size="large"
91-
>
92-
Add Account
93-
</Button>
94-
)}
95-
</>
96-
}
73+
{currentAccount
74+
? (
75+
<>
76+
<AccountPreview profile={currentAccount} />
77+
</>
78+
)
79+
: (
80+
<>
81+
{profile
82+
? (
83+
<>
84+
<AccountPreview profile={profile} />
85+
</>
86+
)
87+
: (
88+
<Button
89+
color="primary"
90+
isPending={isPending}
91+
onClick={onClick}
92+
size="large"
93+
>
94+
Add Account
95+
</Button>
96+
)}
97+
</>
98+
)}
9799
</div>
98100
);
99101
}

apps/oneclient/frontend/src/routes/onboarding/language.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,14 @@ const languageList: Array<Language> = [
2121
},
2222
];
2323

24-
2524
function RouteComponent() {
2625
return (
27-
<div className='flex flex-row h-full p-24 pt-48 gap-8'>
28-
<div className='h-full w-1/3'>
29-
<img src={Illustration} alt="Language selection illustration" />
26+
<div className="flex flex-row h-full p-24 pt-48 gap-8">
27+
<div className="h-full w-1/3">
28+
<img alt="Language selection illustration" src={Illustration} />
3029
</div>
3130

32-
<div className='flex flex-col w-2/3'>
31+
<div className="flex flex-col w-2/3">
3332
<h1 className="text-4xl font-semibold mb-2">Language</h1>
3433
<p className="text-slate-400 text-lg mb-2">Choose your preferred language.</p>
3534

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { createFileRoute } from '@tanstack/react-router'
1+
import { createFileRoute } from '@tanstack/react-router';
22

33
export const Route = createFileRoute('/onboarding/preferences/')({
4-
component: RouteComponent,
5-
})
4+
component: RouteComponent,
5+
});
66

77
function RouteComponent() {
8-
return <div>Hello "/onboarding/preferences/"!</div>
8+
return <div>Hello "/onboarding/preferences/"!</div>;
99
}

apps/oneclient/frontend/src/routes/onboarding/route.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,8 @@ export function OnboardingNavigation() {
189189
)}
190190
</div>
191191
<div>
192-
<Link disabled={forceLoginDisable} to={nextPath ?? "/app"}>
193-
<Button className={`w-32 ${forceLoginDisable ? "line-through" : ""}`} color={forceLoginDisable ? 'secondary' : 'primary'}>Next</Button>
192+
<Link disabled={forceLoginDisable} to={nextPath ?? '/app'}>
193+
<Button className={`w-32 ${forceLoginDisable ? 'line-through' : ''}`} color={forceLoginDisable ? 'secondary' : 'primary'}>Next</Button>
194194
</Link>
195195
</div>
196196
</div>

apps/onelauncher/frontend/src/routes/app/cluster/settings.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function RouteComponent() {
1818
enabled: !!cluster.data?.setting_profile_name,
1919
});
2020

21-
const save = useCommand('updateClusterProfile', () => bindings.core.updateClusterProfile(cluster.data?.name as string, _result.data!), {
21+
const save = useCommand('updateClusterProfile', () => bindings.core.updateClusterProfile(cluster.data?.name as string, _result.data), {
2222
enabled: false,
2323
subscribed: false,
2424
});
@@ -36,9 +36,9 @@ function RouteComponent() {
3636
<div className="h-full">
3737
<h1>Minecraft Settings</h1>
3838

39-
<GameSettings key={_result.data?.name} settings={_result.data!} />
39+
<GameSettings key={_result.data?.name} settings={_result.data} />
4040

41-
<ProcessSettings key={_result.data?.name} settings={_result.data!} />
41+
<ProcessSettings key={_result.data?.name} settings={_result.data} />
4242
</div>
4343
</ScrollableContainer>
4444
</Sidebar.Page>

0 commit comments

Comments
 (0)