style: lint code

This commit is contained in:
ReaJason
2025-09-12 22:51:50 +08:00
parent ee1b2db869
commit 48a65574aa
10 changed files with 50 additions and 43 deletions
+1 -1
View File
@@ -15,7 +15,7 @@
"!**/.turbo", "!**/.turbo",
"!**/.source", "!**/.source",
"!**/convex/_generated", "!**/convex/_generated",
"!**/components/ui/**" "!**/components/ui"
] ]
}, },
"formatter": { "formatter": {
@@ -44,7 +44,7 @@ import {
SelectValue, SelectValue,
} from "@/components/ui/select.tsx"; } from "@/components/ui/select.tsx";
import { Switch } from "@/components/ui/switch.tsx"; import { Switch } from "@/components/ui/switch.tsx";
import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs"; import { Tabs } from "@/components/ui/tabs";
import { import {
type MainConfig, type MainConfig,
type ServerConfig, type ServerConfig,
@@ -133,7 +133,7 @@ export default function MainConfigCard({
// 特殊环境的 JDK 版本 // 特殊环境的 JDK 版本
if ( if (
(value === "SpringWebFlux" || value === "XXLJOB") && (value === "SpringWebFlux" || value === "XXLJOB") &&
Number.parseInt(form.getValues("targetJdkVersion") as string) < 52 Number.parseInt(form.getValues("targetJdkVersion") as string, 10) < 52
) { ) {
form.setValue("targetJdkVersion", "52"); form.setValue("targetJdkVersion", "52");
} else { } else {
+1 -1
View File
@@ -47,7 +47,7 @@ function safeParseYup<T>(schema: yup.ObjectSchema<any>, data: unknown) {
} }
const createEnv = () => { const createEnv = () => {
// @ts-ignore // @ts-expect-error
const envVars = Object.entries(import.meta.env).reduce< const envVars = Object.entries(import.meta.env).reduce<
Record<string, string> Record<string, string>
>((acc, curr) => { >((acc, curr) => {
+1 -1
View File
@@ -34,4 +34,4 @@
"usage": "Usage", "usage": "Usage",
"version.updateAvailable": "Update Available", "version.updateAvailable": "Update Available",
"version.updateAvailableTooltip": "Click to Open Github Release Page ( v{{currentVersion}} -> v{{latestVersion}})" "version.updateAvailableTooltip": "Click to Open Github Release Page ( v{{currentVersion}} -> v{{latestVersion}})"
} }
+1 -1
View File
@@ -34,4 +34,4 @@
"usage": "使用指南", "usage": "使用指南",
"version.updateAvailable": "有可用升级", "version.updateAvailable": "有可用升级",
"version.updateAvailableTooltip": "点击前往 GitHub Release ( v{{currentVersion}} -> v{{latestVersion}})" "version.updateAvailableTooltip": "点击前往 GitHub Release ( v{{currentVersion}} -> v{{latestVersion}})"
} }
+2 -1
View File
@@ -161,7 +161,8 @@
@apply bg-background text-foreground; @apply bg-background text-foreground;
} }
html, body { html,
body {
overflow: hidden; overflow: hidden;
height: 100%; height: 100%;
margin: 0; margin: 0;
+5 -1
View File
@@ -136,7 +136,11 @@ export default function MemShellPage() {
form={form} form={form}
/> />
<PackageConfigCard packerConfig={packerConfig} form={form} /> <PackageConfigCard packerConfig={packerConfig} form={form} />
<Button className="w-full" type="submit" disabled={isActionPending}> <Button
className="w-full"
type="submit"
disabled={isActionPending}
>
{isActionPending ? ( {isActionPending ? (
<LoaderCircle className="animate-spin" /> <LoaderCircle className="animate-spin" />
) : ( ) : (
+5 -1
View File
@@ -110,7 +110,11 @@ export default function ProbeShellGenerator() {
<div className="w-full xl:w-1/2 flex flex-col gap-4"> <div className="w-full xl:w-1/2 flex flex-col gap-4">
<MainConfigCard form={form} servers={serverConfig} /> <MainConfigCard form={form} servers={serverConfig} />
<PackageConfigCard form={form} packerConfig={packerConfig} /> <PackageConfigCard form={form} packerConfig={packerConfig} />
<Button className="w-full" type="submit" disabled={isActionPending}> <Button
className="w-full"
type="submit"
disabled={isActionPending}
>
{isActionPending ? ( {isActionPending ? (
<LoaderCircle className="animate-spin" /> <LoaderCircle className="animate-spin" />
) : ( ) : (
+31 -33
View File
@@ -1,9 +1,9 @@
import { createHashRouter } from "react-router-dom"; import { createHashRouter } from "react-router-dom";
import RootLayout from "@/components/layouts/root-layout"; import RootLayout from "@/components/layouts/root-layout";
import AboutPage from "@/pages/about";
import MemShellPage from "@/pages/memshell"; import MemShellPage from "@/pages/memshell";
import ProbeShellPage from "@/pages/probeshell"; import ProbeShellPage from "@/pages/probeshell";
import type { MemShellFormSchema } from "@/types/schema"; import type { MemShellFormSchema } from "@/types/schema";
import AboutPage from "@/pages/about";
// Function to parse URL parameters into form default values // Function to parse URL parameters into form default values
const parseUrlParams = ( const parseUrlParams = (
@@ -63,37 +63,35 @@ const parseUrlParams = (
return result; return result;
}; };
export const router = createHashRouter( export const router = createHashRouter([
[ {
{ path: "/",
path: "/", element: <RootLayout />,
element: <RootLayout />, children: [
children: [ {
{ index: true,
index: true, element: <MemShellPage />,
element: <MemShellPage />, loader: ({ request }) => {
loader: ({ request }) => { const url = new URL(request.url);
const url = new URL(request.url); return parseUrlParams(url.searchParams);
return parseUrlParams(url.searchParams);
},
}, },
{ },
path: "memshell", {
element: <MemShellPage />, path: "memshell",
loader: ({ request }) => { element: <MemShellPage />,
const url = new URL(request.url); loader: ({ request }) => {
return parseUrlParams(url.searchParams); const url = new URL(request.url);
}, return parseUrlParams(url.searchParams);
}, },
{ },
path: "probeshell", {
element: <ProbeShellPage />, path: "probeshell",
}, element: <ProbeShellPage />,
{ },
path: "about", {
element: <AboutPage />, path: "about",
}, element: <AboutPage />,
], },
}, ],
] },
); ]);
+1 -1
View File
@@ -1,8 +1,8 @@
import path from "node:path"; import path from "node:path";
import { env } from "node:process";
import tailwindcss from "@tailwindcss/vite"; import tailwindcss from "@tailwindcss/vite";
import react from "@vitejs/plugin-react"; import react from "@vitejs/plugin-react";
import { defineConfig } from "vite"; import { defineConfig } from "vite";
import { env } from "node:process";
// https://vitejs.dev/config/ // https://vitejs.dev/config/
export default defineConfig({ export default defineConfig({