fix: eslint (#378)
* fix: eslint script closes #345 * format: eslint oneclient * fix eslint script again :pleading:
This commit is contained in:
parent
6ef5e6354e
commit
b610c1caac
14 changed files with 92 additions and 76 deletions
|
|
@ -50,7 +50,7 @@ export function SkinViewer({
|
|||
enableZoom = true,
|
||||
enableRotate = true,
|
||||
enablePan = true,
|
||||
elytra = false
|
||||
elytra = false,
|
||||
}: SkinViewerProps) {
|
||||
const canvasRef = useRef<HTMLCanvasElement>(null);
|
||||
const viewerRef = useRef<skinviewer.SkinViewer | null>(null);
|
||||
|
|
@ -78,13 +78,12 @@ export function SkinViewer({
|
|||
viewer.controls.object.position.set(x, y, z);
|
||||
viewer.controls.object.lookAt(viewer.controls.target);
|
||||
};
|
||||
setAngle(playerRotatePhi, playerRotateTheta)
|
||||
setAngle(playerRotatePhi, playerRotateTheta);
|
||||
|
||||
viewer.playerWrapper.translateX(translateRotateX);
|
||||
viewer.playerWrapper.translateY(translateRotateY);
|
||||
viewer.playerWrapper.translateZ(translateRotateZ);
|
||||
|
||||
|
||||
viewer.animation = animation;
|
||||
|
||||
viewer.autoRotate = autoRotate;
|
||||
|
|
|
|||
|
|
@ -14,7 +14,12 @@ export function RemoveAccountModal({
|
|||
<Overlay.Dialog>
|
||||
<Overlay.Title>Are you sure?</Overlay.Title>
|
||||
|
||||
<p>Do you want to remove <span className='font-bold' color='primary'>{profile.username}</span> from you're accounts?</p>
|
||||
<p>
|
||||
Do you want to remove
|
||||
<span className="font-bold" color="primary">{profile.username}</span>
|
||||
{' '}
|
||||
from you're accounts?
|
||||
</p>
|
||||
<p>This cannot be undone</p>
|
||||
|
||||
<AccountRow profile={profile} />
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { Button } from '@onelauncher/common/components';
|
||||
import { Overlay } from './Overlay';
|
||||
|
||||
export function RemoveSkinCapeModal({ onPress }: { onPress: () => void; }) {
|
||||
export function RemoveSkinCapeModal({ onPress }: { onPress: () => void }) {
|
||||
return (
|
||||
<Overlay.Dialog>
|
||||
<Overlay.Title>Are you sure?</Overlay.Title>
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import { Overlay } from '@/components/overlay/Overlay';
|
|||
import { usePlayerProfile } from '@/hooks/usePlayerProfile';
|
||||
import { bindings } from '@/main';
|
||||
import { getSkinUrl } from '@/utils/minecraft';
|
||||
import { toast } from '@/utils/toast';
|
||||
import { useCommandSuspense } from '@onelauncher/common';
|
||||
import { Button } from '@onelauncher/common/components';
|
||||
import { useQueryClient } from '@tanstack/react-query';
|
||||
|
|
@ -17,7 +18,6 @@ import { Download01Icon, PlusIcon, Trash01Icon } from '@untitled-theme/icons-rea
|
|||
import { useEffect, useState } from 'react';
|
||||
import { DialogTrigger } from 'react-aria-components';
|
||||
import { CrouchAnimation, FlyingAnimation, HitAnimation, IdleAnimation, WalkingAnimation } from 'skinview3d';
|
||||
import { toast } from '@/utils/toast';
|
||||
|
||||
interface Skin {
|
||||
is_slim: boolean;
|
||||
|
|
@ -113,7 +113,7 @@ function RouteComponent() {
|
|||
|
||||
fetchSkins();
|
||||
|
||||
setCapes([{ url: "", id: "" }, ...loggedInUser.capes.map(cape => ({ url: cape.url, id: cape.id }))]);
|
||||
setCapes([{ url: '', id: '' }, ...loggedInUser.capes.map(cape => ({ url: cape.url, id: cape.id }))]);
|
||||
}, [loggedInUser]);
|
||||
const { data: profile } = usePlayerProfile(currentAccount?.id);
|
||||
const [animation, setAnimation] = useState<PlayerAnimation>(animations[0].animation);
|
||||
|
|
@ -145,14 +145,14 @@ function RouteComponent() {
|
|||
title: 'Import Skin',
|
||||
message: `Importing skin from ${username}`,
|
||||
});
|
||||
const { id } = await bindings.core.convertUsernameUUID(username) ?? { id: '', username: '' }
|
||||
const { id } = await bindings.core.convertUsernameUUID(username);
|
||||
if (id === '')
|
||||
return toast({
|
||||
type: 'error',
|
||||
title: 'Import Skin',
|
||||
message: `${username} doesn't exist`,
|
||||
});
|
||||
const playerProfile = await bindings.core.fetchMinecraftProfile(id)
|
||||
const playerProfile = await bindings.core.fetchMinecraftProfile(id);
|
||||
if (playerProfile.skin_url)
|
||||
setSkins([...skins, { is_slim: playerProfile.is_slim, skin_url: playerProfile.skin_url }]);
|
||||
toast({
|
||||
|
|
@ -160,7 +160,7 @@ function RouteComponent() {
|
|||
title: 'Import Skin',
|
||||
message: `Imported skin from ${username}`,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const [shouldShowElytra, setShouldShowElytra] = useState<boolean>(false);
|
||||
|
||||
|
|
@ -170,11 +170,13 @@ function RouteComponent() {
|
|||
return;
|
||||
await bindings.core.changeSkin(currentAccount.access_token, selectedSkin.skin_url, selectedSkin.is_slim ? 'slim' : 'classic');
|
||||
if (selectedCape === '') {
|
||||
await bindings.core.removeCape(currentAccount.access_token)
|
||||
} else {
|
||||
const capeData = capes.find((cape) => cape.url === selectedCape)
|
||||
if (!capeData) return
|
||||
await bindings.core.changeCape(currentAccount.access_token, capeData.id)
|
||||
await bindings.core.removeCape(currentAccount.access_token);
|
||||
}
|
||||
else {
|
||||
const capeData = capes.find(cape => cape.url === selectedCape);
|
||||
if (!capeData)
|
||||
return;
|
||||
await bindings.core.changeCape(currentAccount.access_token, capeData.id);
|
||||
}
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: ['getDefaultUser'],
|
||||
|
|
@ -363,16 +365,16 @@ function RenderSkin({ skin, selected, animation, setSelectedSkin, setSkins, cape
|
|||
{selected.skin_url === skin.skin_url
|
||||
? <></>
|
||||
: (
|
||||
<DialogTrigger>
|
||||
<Button className="group w-8 h-8 absolute top-0 right-0" color="ghost" size="icon">
|
||||
<Trash01Icon className="group-hover:stroke-danger" />
|
||||
</Button>
|
||||
<DialogTrigger>
|
||||
<Button className="group w-8 h-8 absolute top-0 right-0" color="ghost" size="icon">
|
||||
<Trash01Icon className="group-hover:stroke-danger" />
|
||||
</Button>
|
||||
|
||||
<Overlay>
|
||||
<RemoveSkinCapeModal onPress={() => setSkins(prev => prev.filter(skinData => skinData.skin_url !== skin.skin_url))} />
|
||||
</Overlay>
|
||||
</DialogTrigger>
|
||||
)}
|
||||
<Overlay>
|
||||
<RemoveSkinCapeModal onPress={() => setSkins(prev => prev.filter(skinData => skinData.skin_url !== skin.skin_url))} />
|
||||
</Overlay>
|
||||
</DialogTrigger>
|
||||
)}
|
||||
<Button
|
||||
className="group w-8 h-8 absolute bottom-0 right-0"
|
||||
color="ghost"
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import Sidebar from './route';
|
|||
|
||||
export const Route = createFileRoute('/app/settings/developer')({
|
||||
component: RouteComponent,
|
||||
})
|
||||
});
|
||||
|
||||
function RouteComponent() {
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -70,30 +70,32 @@ function RouteComponent() {
|
|||
<h1 className="text-4xl font-semibold mb-2">Account</h1>
|
||||
<p className="text-slate-400 text-lg mb-2">Before you continue, we require you to own a copy of Minecraft: Java Edition.</p>
|
||||
</div>
|
||||
{currentAccount ?
|
||||
<>
|
||||
<AccountPreview profile={currentAccount} />
|
||||
</>
|
||||
:
|
||||
<>
|
||||
{profile
|
||||
? (
|
||||
<>
|
||||
<AccountPreview profile={profile} />
|
||||
</>
|
||||
)
|
||||
: (
|
||||
<Button
|
||||
color="primary"
|
||||
isPending={isPending}
|
||||
onClick={onClick}
|
||||
size="large"
|
||||
>
|
||||
Add Account
|
||||
</Button>
|
||||
)}
|
||||
</>
|
||||
}
|
||||
{currentAccount
|
||||
? (
|
||||
<>
|
||||
<AccountPreview profile={currentAccount} />
|
||||
</>
|
||||
)
|
||||
: (
|
||||
<>
|
||||
{profile
|
||||
? (
|
||||
<>
|
||||
<AccountPreview profile={profile} />
|
||||
</>
|
||||
)
|
||||
: (
|
||||
<Button
|
||||
color="primary"
|
||||
isPending={isPending}
|
||||
onClick={onClick}
|
||||
size="large"
|
||||
>
|
||||
Add Account
|
||||
</Button>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,15 +21,14 @@ const languageList: Array<Language> = [
|
|||
},
|
||||
];
|
||||
|
||||
|
||||
function RouteComponent() {
|
||||
return (
|
||||
<div className='flex flex-row h-full p-24 pt-48 gap-8'>
|
||||
<div className='h-full w-1/3'>
|
||||
<img src={Illustration} alt="Language selection illustration" />
|
||||
<div className="flex flex-row h-full p-24 pt-48 gap-8">
|
||||
<div className="h-full w-1/3">
|
||||
<img alt="Language selection illustration" src={Illustration} />
|
||||
</div>
|
||||
|
||||
<div className='flex flex-col w-2/3'>
|
||||
<div className="flex flex-col w-2/3">
|
||||
<h1 className="text-4xl font-semibold mb-2">Language</h1>
|
||||
<p className="text-slate-400 text-lg mb-2">Choose your preferred language.</p>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import { createFileRoute } from '@tanstack/react-router'
|
||||
import { createFileRoute } from '@tanstack/react-router';
|
||||
|
||||
export const Route = createFileRoute('/onboarding/preferences/')({
|
||||
component: RouteComponent,
|
||||
})
|
||||
component: RouteComponent,
|
||||
});
|
||||
|
||||
function RouteComponent() {
|
||||
return <div>Hello "/onboarding/preferences/"!</div>
|
||||
return <div>Hello "/onboarding/preferences/"!</div>;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -189,8 +189,8 @@ export function OnboardingNavigation() {
|
|||
)}
|
||||
</div>
|
||||
<div>
|
||||
<Link disabled={forceLoginDisable} to={nextPath ?? "/app"}>
|
||||
<Button className={`w-32 ${forceLoginDisable ? "line-through" : ""}`} color={forceLoginDisable ? 'secondary' : 'primary'}>Next</Button>
|
||||
<Link disabled={forceLoginDisable} to={nextPath ?? '/app'}>
|
||||
<Button className={`w-32 ${forceLoginDisable ? 'line-through' : ''}`} color={forceLoginDisable ? 'secondary' : 'primary'}>Next</Button>
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ function RouteComponent() {
|
|||
enabled: !!cluster.data?.setting_profile_name,
|
||||
});
|
||||
|
||||
const save = useCommand('updateClusterProfile', () => bindings.core.updateClusterProfile(cluster.data?.name as string, _result.data!), {
|
||||
const save = useCommand('updateClusterProfile', () => bindings.core.updateClusterProfile(cluster.data?.name as string, _result.data), {
|
||||
enabled: false,
|
||||
subscribed: false,
|
||||
});
|
||||
|
|
@ -36,9 +36,9 @@ function RouteComponent() {
|
|||
<div className="h-full">
|
||||
<h1>Minecraft Settings</h1>
|
||||
|
||||
<GameSettings key={_result.data?.name} settings={_result.data!} />
|
||||
<GameSettings key={_result.data?.name} settings={_result.data} />
|
||||
|
||||
<ProcessSettings key={_result.data?.name} settings={_result.data!} />
|
||||
<ProcessSettings key={_result.data?.name} settings={_result.data} />
|
||||
</div>
|
||||
</ScrollableContainer>
|
||||
</Sidebar.Page>
|
||||
|
|
|
|||
|
|
@ -223,7 +223,9 @@ function ClusterCard({
|
|||
</div>
|
||||
|
||||
{/* <LaunchButton cluster={props} iconOnly /> */}
|
||||
<Button onClick={handleLaunch} size="icon"><PlayIcon /></Button>
|
||||
<Button onClick={handleLaunch} size="icon">
|
||||
<PlayIcon />
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</Link>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ export const Route = createFileRoute('/app/settings/minecraft')({
|
|||
function RouteComponent() {
|
||||
const result = useCommand('readSettings', bindings.core.readSettings);
|
||||
|
||||
const save = useCommand('writeSettings', () => bindings.core.writeSettings(result.data!), {
|
||||
const save = useCommand('writeSettings', () => bindings.core.writeSettings(result.data), {
|
||||
enabled: false,
|
||||
subscribed: false,
|
||||
});
|
||||
|
|
@ -31,11 +31,11 @@ function RouteComponent() {
|
|||
<div className="h-full">
|
||||
<h1>Minecraft Settings</h1>
|
||||
|
||||
<GameSettings settings={result.data!.global_game_settings} />
|
||||
<GameSettings settings={result.data.global_game_settings} />
|
||||
|
||||
{/* <LauncherSettings /> */}
|
||||
|
||||
<ProcessSettings settings={result.data!.global_game_settings} />
|
||||
<ProcessSettings settings={result.data.global_game_settings} />
|
||||
</div>
|
||||
</ScrollableContainer>
|
||||
</Sidebar.Page>
|
||||
|
|
|
|||
|
|
@ -2,12 +2,21 @@ import { defineConfig } from '@flowr/eslint';
|
|||
// @ts-ignore -- No types for this package
|
||||
import { tanstackConfig } from '@tanstack/eslint-config';
|
||||
|
||||
const ignores = [
|
||||
'*.rs',
|
||||
'**/migrations/**',
|
||||
'apps/onelauncher/old_frontend',
|
||||
'apps/*/desktop/capabilities',
|
||||
'apps/*/desktop/gen',
|
||||
'**/*.gen.*',
|
||||
];
|
||||
|
||||
export default defineConfig(
|
||||
{
|
||||
typescript: true,
|
||||
react: true,
|
||||
query: true,
|
||||
ignores: ['*.rs', '**/migrations/**'],
|
||||
ignores,
|
||||
toml: {
|
||||
overrides: {
|
||||
'toml/array-element-newline': ['error', 'always'],
|
||||
|
|
@ -24,12 +33,7 @@ export default defineConfig(
|
|||
return config;
|
||||
}),
|
||||
{
|
||||
ignores: [
|
||||
'apps/onelauncher/old_frontend',
|
||||
'apps/*/desktop/capabilities',
|
||||
'apps/*/desktop/gen',
|
||||
'**/*.gen.*',
|
||||
],
|
||||
ignores,
|
||||
// overrides: [
|
||||
// {
|
||||
// files: ['vite.config.js'],
|
||||
|
|
@ -40,6 +44,7 @@ export default defineConfig(
|
|||
// ],
|
||||
},
|
||||
{
|
||||
ignores,
|
||||
rules: {
|
||||
'sort-imports': 'off', // Replaced by perfectionist/sort-named-imports',
|
||||
'import/order': 'off', // Replaced by perfectionist/sort-named-imports',
|
||||
|
|
|
|||
|
|
@ -34,10 +34,12 @@
|
|||
"web_common": "pnpm --filter @onelauncher/common -- ",
|
||||
"scripts": "pnpm --filter @onelauncher/scripts -- ",
|
||||
"format": "pnpm format:es && pnpm format:rs",
|
||||
"format:es": "pnpm lint:es --fix",
|
||||
"format:es": "pnpm lint:apps:es --fix && pnpm lint:packages:es --fix",
|
||||
"format:rs": "cargo +nightly fmt && cargo clippy --fix",
|
||||
"lint": "pnpm lint:es && pnpm lint:rs",
|
||||
"lint:es": "eslint . --cache",
|
||||
"lint:es": "pnpm lint:apps:es && pnpm lint:packages:es",
|
||||
"lint:apps:es": "pnpm exec eslint apps/ --cache",
|
||||
"lint:packages:es": "pnpm exec eslint packages/ --cache",
|
||||
"lint:rs": "cargo +nightly fmt --check && cargo clippy -- -D warnings",
|
||||
"prepare": "husky"
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue