From 3cfbcdeedc849cc0e8231cb729cd5e49afc7b579 Mon Sep 17 00:00:00 2001 From: Mark Street <22226349+mkst@users.noreply.github.com> Date: Sun, 8 Dec 2024 22:03:46 +0000 Subject: [PATCH 1/3] Pass 'mipsel' as arch to m2c for le mips arches (#1395) --- backend/coreapp/m2c_wrapper.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/coreapp/m2c_wrapper.py b/backend/coreapp/m2c_wrapper.py index 1a3c08df2..3aeb8f633 100644 --- a/backend/coreapp/m2c_wrapper.py +++ b/backend/coreapp/m2c_wrapper.py @@ -18,7 +18,9 @@ class M2CError(Exception): class M2CWrapper: @staticmethod def get_triple(compiler: Compiler, arch: str) -> str: - if "mips" in arch: + if "mipse" in arch: + t_arch = "mipsel" + elif "mips" in arch: t_arch = "mips" elif "ppc" in arch: t_arch = "ppc" From a003f5b46273cc1e6755937336139a6771db751f Mon Sep 17 00:00:00 2001 From: Ethan Roseman Date: Wed, 11 Dec 2024 00:57:41 +0900 Subject: [PATCH 2/3] Run Biome linter (#1391) * Backend updates * frontend updates * Undo 15 * Undo 15 * oops * oops * oops * make thing not hook * regen yarn.lock * oops * The resize observer * oops * hamster help * more updates * more * fixules * more migration * meowp * one * un-frug * useImportType * useTemplate * useNumberNamespace * noUselessFragments * useLiteralKeys * useOptionalChain * noUnnecessaryContinue * noUnreachable * noDoubleEquals * useSortedClasses * removed unneded file * delete later * Promment * useSingleVarDeclarator * useSelfClosingElements * noConfusingVoidType * wut * noAccumulatingSpread * noForEach * noAssignInExpressions * cleanups * useDefaultParameterLast * useEnumInitializers * useNodejsImportProtocol --- frontend/biome.json | 31 +++------- frontend/next.config.js | 4 +- frontend/src/app/(navfooter)/SiteStats.tsx | 4 +- frontend/src/app/(navfooter)/WelcomeInfo.tsx | 6 +- .../(navfooter)/credits/ContributorsList.tsx | 17 ++++-- frontend/src/app/(navfooter)/credits/page.tsx | 8 +-- frontend/src/app/(navfooter)/faq/page.tsx | 4 +- frontend/src/app/(navfooter)/login/page.tsx | 6 +- .../app/(navfooter)/new/NewScratchForm.tsx | 56 +++++++++---------- frontend/src/app/(navfooter)/new/layout.tsx | 2 +- frontend/src/app/(navfooter)/new/page.tsx | 2 +- frontend/src/app/(navfooter)/page.tsx | 2 +- .../app/(navfooter)/platform/[id]/page.tsx | 12 ++-- .../src/app/(navfooter)/preset/[id]/page.tsx | 12 ++-- .../src/app/(navfooter)/preset/presets.tsx | 6 +- frontend/src/app/(navfooter)/privacy/page.tsx | 6 +- .../src/app/(navfooter)/settings/Checkbox.tsx | 4 +- .../src/app/(navfooter)/settings/NavItem.tsx | 6 +- .../app/(navfooter)/settings/RadioList.tsx | 4 +- .../src/app/(navfooter)/settings/Section.tsx | 4 +- .../app/(navfooter)/settings/SliderField.tsx | 6 +- .../app/(navfooter)/settings/TextField.tsx | 6 +- .../appearance/AppearanceSettings.tsx | 2 +- .../src/app/(navfooter)/settings/layout.tsx | 2 +- .../src/app/(navfooter)/u/[username]/page.tsx | 4 +- frontend/src/app/ThemeProvider.tsx | 2 +- frontend/src/app/error.tsx | 4 +- frontend/src/app/not-found.tsx | 2 +- .../src/app/scratch/[slug]/ScratchEditor.tsx | 2 +- .../app/scratch/[slug]/getScratchDetails.ts | 2 +- frontend/src/app/scratch/[slug]/loading.tsx | 8 +-- .../app/scratch/[slug]/opengraph-image.tsx | 8 +-- frontend/src/app/scratch/[slug]/page.tsx | 2 +- frontend/src/components/AsyncButton.tsx | 4 +- frontend/src/components/Breadcrumbs.tsx | 4 +- frontend/src/components/Button.tsx | 2 +- frontend/src/components/ColorSchemeEditor.tsx | 2 +- frontend/src/components/ColorSchemePicker.tsx | 2 +- frontend/src/components/CustomLayout.tsx | 6 +- .../src/components/Diff/CompilationPanel.tsx | 20 +++---- frontend/src/components/Diff/Diff.tsx | 18 +++--- .../src/components/Diff/DiffRowAsmDiffer.tsx | 18 +++--- .../src/components/Diff/DiffRowObjdiff.tsx | 16 +++--- frontend/src/components/DismissableBanner.tsx | 2 +- frontend/src/components/Editor/CodeMirror.tsx | 8 +-- frontend/src/components/ErrorBoundary.tsx | 2 +- frontend/src/components/Footer.tsx | 6 +- frontend/src/components/GhostButton.tsx | 2 +- frontend/src/components/Logotype.tsx | 2 +- frontend/src/components/Nav/Nav.tsx | 2 +- frontend/src/components/Nav/Search.tsx | 2 +- frontend/src/components/NumberInput.tsx | 6 +- frontend/src/components/PlatformLink.tsx | 2 +- .../src/components/PlatformSelect/index.ts | 2 +- frontend/src/components/PresetList.tsx | 2 +- frontend/src/components/Scratch/Scratch.tsx | 6 +- .../components/Scratch/ScratchMatchBanner.tsx | 6 +- .../src/components/Scratch/ScratchToolbar.tsx | 16 +++--- .../components/Scratch/SortableFamilyList.tsx | 4 +- .../Scratch/hooks/useFuzzySaveCallback.ts | 6 +- .../Scratch/hooks/useLanguageServer.ts | 8 +-- frontend/src/components/Scratch/index.ts | 2 +- .../components/Scratch/panels/AboutPanel.tsx | 4 +- .../Scratch/panels/DecompilePanel.tsx | 10 ++-- .../components/Scratch/panels/FamilyPanel.tsx | 2 +- frontend/src/components/ScratchList.tsx | 6 +- frontend/src/components/Select.tsx | 2 +- frontend/src/components/Shortcut.tsx | 6 +- frontend/src/components/Sort.tsx | 10 ++-- frontend/src/components/Tabs.tsx | 3 +- frontend/src/components/ThemePicker.tsx | 6 +- frontend/src/components/VerticalMenu.tsx | 4 +- frontend/src/components/YourScratchList.tsx | 2 +- .../src/components/compiler/CompilerOpts.tsx | 30 +++++----- .../src/components/compiler/PresetSelect.tsx | 2 +- frontend/src/components/compiler/compilers.ts | 2 +- .../src/components/user/AnonymousFrog.tsx | 8 +-- frontend/src/components/user/Profile.tsx | 8 +-- frontend/src/components/user/UserLink.tsx | 4 +- frontend/src/components/user/UserMention.tsx | 2 +- .../src/components/user/tabs/ScratchesTab.tsx | 4 +- frontend/src/lib/api.ts | 8 +-- frontend/src/lib/api/request.ts | 4 +- frontend/src/lib/api/types.ts | 2 +- frontend/src/lib/api/urls.ts | 2 +- frontend/src/lib/codemirror/basic-setup.ts | 2 +- .../lib/codemirror/default-keymap/indent.ts | 2 +- .../lib/codemirror/default-keymap/index.ts | 2 +- .../codemirror/default-keymap/multiCursor.ts | 2 +- frontend/src/lib/codemirror/default-theme.ts | 14 ++--- frontend/src/lib/codemirror/languageServer.ts | 21 ++++--- .../src/lib/codemirror/useCompareExtension.ts | 10 ++-- frontend/src/lib/device.ts | 2 +- frontend/src/lib/hooks.ts | 5 +- frontend/src/lib/interdiff.ts | 14 ++--- frontend/src/lib/oauth.ts | 2 +- frontend/src/lib/objdiff.ts | 2 +- frontend/src/lib/settings.ts | 4 +- frontend/tailwind.config.js | 5 +- 99 files changed, 315 insertions(+), 327 deletions(-) diff --git a/frontend/biome.json b/frontend/biome.json index 97e221dfb..d7f2f35b1 100644 --- a/frontend/biome.json +++ b/frontend/biome.json @@ -22,16 +22,8 @@ "rules": { "recommended": true, "style": { - "useImportType": "off", - "useTemplate": "off", "noUselessElse": "off", - "noParameterAssign": "off", - "useNumberNamespace": "off", - "useDefaultParameterLast": "off", - "useEnumInitializers": "off", - "useSingleVarDeclarator": "off", - "useSelfClosingElements": "off", - "useNodejsImportProtocol": "off" + "noParameterAssign": "off" }, "a11y": { "useValidAnchor": "off", @@ -44,25 +36,16 @@ "suspicious": { "noExplicitAny": "off", "noArrayIndexKey": "off", - "noDoubleEquals": "off", - "noAssignInExpressions": "off", - "noConfusingVoidType": "off", - "noImplicitAnyLet": "off" + "noConfusingVoidType": "off" }, "correctness": { - "useExhaustiveDependencies": "off", - "noUnreachable": "off", - "noUnnecessaryContinue": "off" - }, - "complexity": { - "useLiteralKeys": "off", - "useOptionalChain": "off", - "noForEach": "off", - "noUselessFragments": "off" + "useExhaustiveDependencies": "off" }, "performance": { - "noDelete": "off", - "noAccumulatingSpread": "off" + "noDelete": "off" + }, + "nursery": { + "useSortedClasses": "error" } } }, diff --git a/frontend/next.config.js b/frontend/next.config.js index 556439f21..fb8c8b2ec 100644 --- a/frontend/next.config.js +++ b/frontend/next.config.js @@ -1,5 +1,5 @@ const { Compilation } = require("webpack") -const { execSync } = require("child_process") +const { execSync } = require("node:child_process") const { config } = require("dotenv") for (const envFile of [".env.local", ".env"]) { @@ -161,7 +161,7 @@ let app = withPlausibleProxy({ }, })) -if (process.env.ANALYZE == "true") { +if (process.env.ANALYZE === "true") { app = require("@next/bundle-analyzer")(app) } diff --git a/frontend/src/app/(navfooter)/SiteStats.tsx b/frontend/src/app/(navfooter)/SiteStats.tsx index 0da570b0d..62efadb4d 100644 --- a/frontend/src/app/(navfooter)/SiteStats.tsx +++ b/frontend/src/app/(navfooter)/SiteStats.tsx @@ -1,6 +1,6 @@ "use client" -import { ReactNode } from "react" +import type { ReactNode } from "react" import Link from "next/link" @@ -25,7 +25,7 @@ export default function SiteStats() { return null } - return

+ return

{stats.scratch_count.toLocaleString()} scratches created {stats.profile_count.toLocaleString()} unique visitors {stats.github_user_count.toLocaleString()} users signed up diff --git a/frontend/src/app/(navfooter)/WelcomeInfo.tsx b/frontend/src/app/(navfooter)/WelcomeInfo.tsx index 70f6939f6..c03ba033d 100644 --- a/frontend/src/app/(navfooter)/WelcomeInfo.tsx +++ b/frontend/src/app/(navfooter)/WelcomeInfo.tsx @@ -15,7 +15,7 @@ export default function WelcomeInfo() { const saveDataEnabled = headers().get("Save-Data") === "on" return

- {!saveDataEnabled &&
+ {!saveDataEnabled &&
}

Collaboratively decompile code in your browser.

-

+

{SITE_DESCRIPTION}

diff --git a/frontend/src/app/(navfooter)/credits/ContributorsList.tsx b/frontend/src/app/(navfooter)/credits/ContributorsList.tsx index 1d47b4049..72ff557b4 100644 --- a/frontend/src/app/(navfooter)/credits/ContributorsList.tsx +++ b/frontend/src/app/(navfooter)/credits/ContributorsList.tsx @@ -2,9 +2,14 @@ import { LinkExternalIcon } from "@primer/octicons-react" import GhostButton from "@/components/GhostButton" import UserAvatar from "@/components/user/UserAvatar" -import UserMention, { GithubUser, getUserName } from "@/components/user/UserMention" +import UserMention, { type GithubUser, getUserName } from "@/components/user/UserMention" import { get } from "@/lib/api/request" -import { User } from "@/lib/api/types" +import type { User } from "@/lib/api/types" + +interface GitHubContributor { + login: string + contributions: number +} export type Contributor = User | GithubUser @@ -19,9 +24,9 @@ export async function getContributorUsernames(): Promise { return ["ethteck", "nanaian"] } - const contributors = await req.json() - contributors.sort((a: any, b: any) => b.contributions - a.contributions) - return contributors.map((contributor: any) => contributor.login) + const contributors = await req.json() as GitHubContributor[] + contributors.sort((a, b) => b.contributions - a.contributions) + return contributors.map((contributor) => contributor.login) } export async function usernameToContributor(username: string): Promise { @@ -49,7 +54,7 @@ export default function ContributorsList({ contributors }: { contributors: Contr return
-

+

Contributors

diff --git a/frontend/src/app/(navfooter)/credits/page.tsx b/frontend/src/app/(navfooter)/credits/page.tsx index 15f230927..3f27e335f 100644 --- a/frontend/src/app/(navfooter)/credits/page.tsx +++ b/frontend/src/app/(navfooter)/credits/page.tsx @@ -1,6 +1,6 @@ import UserMention from "@/components/user/UserMention" import { get } from "@/lib/api/request" -import { User } from "@/lib/api/types" +import type { User } from "@/lib/api/types" import ContributorsList, { getContributorUsernames, usernameToContributor } from "./ContributorsList" import LinkList from "./LinkList" @@ -72,17 +72,17 @@ export default async function Page() { return
-

+

Credits

decomp.me is maintained by and .

-
+
-

+

Acknowledgements

diff --git a/frontend/src/app/(navfooter)/faq/page.tsx b/frontend/src/app/(navfooter)/faq/page.tsx index cf87ea6a8..65661c48e 100644 --- a/frontend/src/app/(navfooter)/faq/page.tsx +++ b/frontend/src/app/(navfooter)/faq/page.tsx @@ -1,4 +1,4 @@ -import { ReactNode } from "react" +import type { ReactNode } from "react" import Link from "next/link" @@ -22,7 +22,7 @@ export const metadata = { export default function Page() { return

-

+

Frequently Asked Questions

diff --git a/frontend/src/app/(navfooter)/login/page.tsx b/frontend/src/app/(navfooter)/login/page.tsx index 567a4b694..b8c158bfb 100644 --- a/frontend/src/app/(navfooter)/login/page.tsx +++ b/frontend/src/app/(navfooter)/login/page.tsx @@ -46,14 +46,14 @@ function Login() { }) } - if (githubError == "access_denied") { + if (githubError === "access_denied") { setError(new Error("Please grant access to your GitHub account to sign in!")) } }, [code, router, mutate, next, error, githubError]) return
{error ?
-

Error signing in

+

Error signing in

The following error prevented you from signing in:

@@ -64,7 +64,7 @@ function Login() { You can try again by clicking the button below.

-
: code ?
+
: code ?
Signing in...
:
diff --git a/frontend/src/app/(navfooter)/new/NewScratchForm.tsx b/frontend/src/app/(navfooter)/new/NewScratchForm.tsx index e7e141cc9..df6f12054 100644 --- a/frontend/src/app/(navfooter)/new/NewScratchForm.tsx +++ b/frontend/src/app/(navfooter)/new/NewScratchForm.tsx @@ -12,7 +12,7 @@ import CodeMirror from "@/components/Editor/CodeMirror" import PlatformSelect from "@/components/PlatformSelect" import Select from "@/components/Select2" import * as api from "@/lib/api" -import { Library } from "@/lib/api/types" +import type { Library } from "@/lib/api/types" import { scratchUrl } from "@/lib/api/urls" import basicSetup from "@/lib/codemirror/basic-setup" import { cpp } from "@/lib/codemirror/cpp" @@ -116,21 +116,21 @@ export default function NewScratchForm({ serverCompilers }: { // Load fields from localStorage useEffect(() => { try { - setLabel(localStorage["new_scratch_label"] ?? "") - setAsm(localStorage["new_scratch_asm"] ?? "") - setContext(localStorage["new_scratch_context"] ?? "") - const pid = parseInt(localStorage["new_scratch_presetId"]) + setLabel(localStorage.new_scratch_label ?? "") + setAsm(localStorage.new_scratch_asm ?? "") + setContext(localStorage.new_scratch_context ?? "") + const pid = Number.parseInt(localStorage.new_scratch_presetId) if (!Number.isNaN(pid)) { const preset = presets[pid] if (preset) { setPreset(preset) } } else { - setPlatform(localStorage["new_scratch_platform"] ?? "") - setCompilerId(localStorage["new_scratch_compilerId"] ?? undefined) - setCompilerFlags(localStorage["new_scratch_compilerFlags"] ?? "") - setDiffFlags(JSON.parse(localStorage["new_scratch_diffFlags"] ?? "[]")) - setLibraries(JSON.parse(localStorage["new_scratch_libraries"] ?? "[]")) + setPlatform(localStorage.new_scratch_platform ?? "") + setCompilerId(localStorage.new_scratch_compilerId ?? undefined) + setCompilerFlags(localStorage.new_scratch_compilerFlags ?? "") + setDiffFlags(JSON.parse(localStorage.new_scratch_diffFlags ?? "[]")) + setLibraries(JSON.parse(localStorage.new_scratch_libraries ?? "[]")) } incrementValueVersion() } catch (error) { @@ -144,18 +144,18 @@ export default function NewScratchForm({ serverCompilers }: { if (!ready) return - localStorage["new_scratch_label"] = label - localStorage["new_scratch_asm"] = asm - localStorage["new_scratch_context"] = context - localStorage["new_scratch_platform"] = platform - localStorage["new_scratch_compilerId"] = compilerId - localStorage["new_scratch_compilerFlags"] = compilerFlags - localStorage["new_scratch_diffFlags"] = JSON.stringify(diffFlags) - localStorage["new_scratch_libraries"] = JSON.stringify(libraries) - if (presetId == undefined) { + localStorage.new_scratch_label = label + localStorage.new_scratch_asm = asm + localStorage.new_scratch_context = context + localStorage.new_scratch_platform = platform + localStorage.new_scratch_compilerId = compilerId + localStorage.new_scratch_compilerFlags = compilerFlags + localStorage.new_scratch_diffFlags = JSON.stringify(diffFlags) + localStorage.new_scratch_libraries = JSON.stringify(libraries) + if (presetId === undefined) { localStorage.removeItem("new_scratch_presetId") } else { - localStorage["new_scratch_presetId"] = presetId + localStorage.new_scratch_presetId = presetId } }, [ready, label, asm, context, platform, compilerId, compilerFlags, diffFlags, libraries, presetId]) @@ -169,7 +169,7 @@ export default function NewScratchForm({ serverCompilers }: { if (!ready) return - if (presetId != undefined || compilerId != undefined) { + if (presetId !== undefined || compilerId !== undefined) { // User has specified a preset or compiler, don't override it return } @@ -192,11 +192,9 @@ export default function NewScratchForm({ serverCompilers }: { const compilersTranslation = getTranslation("compilers") const compilerChoiceOptions = useMemo(() => { return Object.keys(platformCompilers).reduce((sum, id) => { - return { - ...sum, - [id]: compilersTranslation.t(id), - } - }, {}) + sum[id] = compilersTranslation.t(id) + return sum + }, {} as Record) }, [platformCompilers, compilersTranslation]) const submit = async () => { @@ -213,8 +211,8 @@ export default function NewScratchForm({ serverCompilers }: { diff_label: label || defaultLabel || "", }) - localStorage["new_scratch_label"] = "" - localStorage["new_scratch_asm"] = "" + localStorage.new_scratch_label = "" + localStorage.new_scratch_asm = "" await api.claimScratch(scratch) @@ -310,7 +308,7 @@ export default function NewScratchForm({ serverCompilers }: {
diff --git a/frontend/src/app/(navfooter)/new/page.tsx b/frontend/src/app/(navfooter)/new/page.tsx index 96ed61068..09df93979 100644 --- a/frontend/src/app/(navfooter)/new/page.tsx +++ b/frontend/src/app/(navfooter)/new/page.tsx @@ -11,7 +11,7 @@ export default async function NewScratchPage() { const compilers = await get("/compiler") return
-

Start a new scratch

+

Start a new scratch

{DESCRIPTION}

diff --git a/frontend/src/app/(navfooter)/page.tsx b/frontend/src/app/(navfooter)/page.tsx index 52bbd953d..136ff7fb0 100644 --- a/frontend/src/app/(navfooter)/page.tsx +++ b/frontend/src/app/(navfooter)/page.tsx @@ -1,4 +1,4 @@ -import { Metadata } from "next" +import type { Metadata } from "next" import ScratchList, { SingleLineScratchItem } from "@/components/ScratchList" import YourScratchList from "@/components/YourScratchList" diff --git a/frontend/src/app/(navfooter)/platform/[id]/page.tsx b/frontend/src/app/(navfooter)/platform/[id]/page.tsx index 5cfb97b8e..7efb05748 100644 --- a/frontend/src/app/(navfooter)/platform/[id]/page.tsx +++ b/frontend/src/app/(navfooter)/platform/[id]/page.tsx @@ -1,11 +1,11 @@ -import { Metadata } from "next" +import type { Metadata } from "next" import { notFound } from "next/navigation" import { PlatformIcon } from "@/components/PlatformSelect/PlatformIcon" import ScratchList, { ScratchItemPlatformList } from "@/components/ScratchList" import { get } from "@/lib/api/request" -import { PlatformMetadata } from "@/lib/api/types" +import type { PlatformMetadata } from "@/lib/api/types" export async function generateMetadata({ params }: { params: { id: number } }):Promise { let platform: PlatformMetadata @@ -21,9 +21,9 @@ export async function generateMetadata({ params }: { params: { id: number } }):P } let description = "There " - description += platform.num_scratches == 1 ? "is " : "are " - description += platform.num_scratches == 0 ? "currently no " : `${platform.num_scratches.toLocaleString("en-US")} ` - description += platform.num_scratches == 1 ? "scratch " : "scratches " + description += platform.num_scratches === 1 ? "is " : "are " + description += platform.num_scratches === 0 ? "currently no " : `${platform.num_scratches.toLocaleString("en-US")} ` + description += platform.num_scratches === 1 ? "scratch " : "scratches " description += "for this platform." return { @@ -48,7 +48,7 @@ export default async function Page({ params }: { params: { id: number } }) { } return
-
+

{platform.name} diff --git a/frontend/src/app/(navfooter)/preset/[id]/page.tsx b/frontend/src/app/(navfooter)/preset/[id]/page.tsx index 74035468a..de7ff7519 100644 --- a/frontend/src/app/(navfooter)/preset/[id]/page.tsx +++ b/frontend/src/app/(navfooter)/preset/[id]/page.tsx @@ -1,11 +1,11 @@ -import { Metadata } from "next" +import type { Metadata } from "next" import { notFound } from "next/navigation" import { PlatformIcon } from "@/components/PlatformSelect/PlatformIcon" import ScratchList, { ScratchItemPresetList } from "@/components/ScratchList" import { get } from "@/lib/api/request" -import { Preset } from "@/lib/api/types" +import type { Preset } from "@/lib/api/types" import getTranslation from "@/lib/i18n/translate" export async function generateMetadata({ params }: { params: { id: number } }): Promise { @@ -22,9 +22,9 @@ export async function generateMetadata({ params }: { params: { id: number } }): } let description = "There " - description += preset.num_scratches == 1 ? "is " : "are " - description += preset.num_scratches == 0 ? "currently no " : `${preset.num_scratches.toLocaleString("en-US")} ` - description += preset.num_scratches == 1 ? "scratch " : "scratches " + description += preset.num_scratches === 1 ? "is " : "are " + description += preset.num_scratches === 0 ? "currently no " : `${preset.num_scratches.toLocaleString("en-US")} ` + description += preset.num_scratches === 1 ? "scratch " : "scratches " description += "that use this preset." return { @@ -53,7 +53,7 @@ export default async function Page({ params }: { params: { id: number } }) { const compilerName = compilersTranslation.t(preset.compiler) return
-
+

{preset.name} diff --git a/frontend/src/app/(navfooter)/preset/presets.tsx b/frontend/src/app/(navfooter)/preset/presets.tsx index 53bb7dec3..d93d5e096 100644 --- a/frontend/src/app/(navfooter)/preset/presets.tsx +++ b/frontend/src/app/(navfooter)/preset/presets.tsx @@ -4,7 +4,7 @@ import { useState } from "react" import PlatformSelect from "@/components/PlatformSelect" import { PresetList } from "@/components/PresetList" -import * as api from "@/lib/api" +import type * as api from "@/lib/api" export function Presets({ serverCompilers }: { serverCompilers: { @@ -23,13 +23,13 @@ export function Presets({ serverCompilers }: { return (
-

Platforms

+

Platforms

-

Presets

+

Presets

) diff --git a/frontend/src/app/(navfooter)/privacy/page.tsx b/frontend/src/app/(navfooter)/privacy/page.tsx index 162641664..c5eb51897 100644 --- a/frontend/src/app/(navfooter)/privacy/page.tsx +++ b/frontend/src/app/(navfooter)/privacy/page.tsx @@ -9,11 +9,11 @@ export const metadata = { export default function Page() { return
-

+

Privacy policy

-

+

Last updated January 13th 2022

@@ -48,7 +48,7 @@ export default function Page() { All site measurement is carried out absolutely anonymously and in aggregate only. Analytics data collected is limited to:

-
    +
    • Page URL
    • HTTP Referer
    • Browser and operating system (using User-Agent HTTP header, which is discarded)
    • diff --git a/frontend/src/app/(navfooter)/settings/Checkbox.tsx b/frontend/src/app/(navfooter)/settings/Checkbox.tsx index 066ba7cd0..324599990 100644 --- a/frontend/src/app/(navfooter)/settings/Checkbox.tsx +++ b/frontend/src/app/(navfooter)/settings/Checkbox.tsx @@ -1,4 +1,4 @@ -import { ReactNode, useId } from "react" +import { type ReactNode, useId } from "react" export type Props = { checked: boolean @@ -23,7 +23,7 @@ export default function Checkbox({ checked, onChange, label, description, childr

- {description &&
{description}
} + {description &&
{description}
} {children &&
{children}
} diff --git a/frontend/src/app/(navfooter)/settings/NavItem.tsx b/frontend/src/app/(navfooter)/settings/NavItem.tsx index 91e1735ad..1eb5d62cd 100644 --- a/frontend/src/app/(navfooter)/settings/NavItem.tsx +++ b/frontend/src/app/(navfooter)/settings/NavItem.tsx @@ -1,6 +1,6 @@ "use client" -import { ReactNode } from "react" +import type { ReactNode } from "react" import { useSelectedLayoutSegment } from "next/navigation" @@ -21,8 +21,8 @@ export default function NavItem({ segment, label, icon }: Props) { {icon} diff --git a/frontend/src/app/(navfooter)/settings/RadioList.tsx b/frontend/src/app/(navfooter)/settings/RadioList.tsx index 03656b758..92dfb6142 100644 --- a/frontend/src/app/(navfooter)/settings/RadioList.tsx +++ b/frontend/src/app/(navfooter)/settings/RadioList.tsx @@ -1,4 +1,4 @@ -import { ReactNode, useId } from "react" +import { type ReactNode, useId } from "react" function RadioButton({ name, value, checked, onChange, option }: { name: string, value: string, checked: boolean, onChange: (value: string) => void, option: Option }) { const id = useId() @@ -16,7 +16,7 @@ function RadioButton({ name, value, checked, onChange, option }: { name: string,
- {option.description &&
{option.description}
} + {option.description &&
{option.description}
} {option.children &&
{option.children}
} diff --git a/frontend/src/app/(navfooter)/settings/Section.tsx b/frontend/src/app/(navfooter)/settings/Section.tsx index 5275935c4..98c5f7dfa 100644 --- a/frontend/src/app/(navfooter)/settings/Section.tsx +++ b/frontend/src/app/(navfooter)/settings/Section.tsx @@ -1,4 +1,4 @@ -import { ReactNode } from "react" +import type { ReactNode } from "react" export type Props = { title: string @@ -7,7 +7,7 @@ export type Props = { export default function Section({ title, children }: Props) { return
-

{title}

+

{title}

{children}
diff --git a/frontend/src/app/(navfooter)/settings/SliderField.tsx b/frontend/src/app/(navfooter)/settings/SliderField.tsx index 8650ab048..9a2fd1994 100644 --- a/frontend/src/app/(navfooter)/settings/SliderField.tsx +++ b/frontend/src/app/(navfooter)/settings/SliderField.tsx @@ -1,4 +1,4 @@ -import { useId, ReactNode } from "react" +import { useId, type ReactNode } from "react" import classNames from "classnames" @@ -44,7 +44,7 @@ export default function SliderField({ value, onChange, disabled, label, descript {unit}
-
+
{min}{unit}
- {description &&
{description}
} + {description &&
{description}
}
} diff --git a/frontend/src/app/(navfooter)/settings/TextField.tsx b/frontend/src/app/(navfooter)/settings/TextField.tsx index f527970fe..84459ba30 100644 --- a/frontend/src/app/(navfooter)/settings/TextField.tsx +++ b/frontend/src/app/(navfooter)/settings/TextField.tsx @@ -1,4 +1,4 @@ -import { useId, ReactNode, CSSProperties } from "react" +import { useId, type ReactNode, type CSSProperties } from "react" import classNames from "classnames" @@ -26,7 +26,7 @@ export default function TextField({ value, onChange, disabled, label, descriptio - {description &&
{description}
} + {description &&
{description}
}
diff --git a/frontend/src/app/(navfooter)/settings/appearance/AppearanceSettings.tsx b/frontend/src/app/(navfooter)/settings/appearance/AppearanceSettings.tsx index 27d0277de..d71765105 100644 --- a/frontend/src/app/(navfooter)/settings/appearance/AppearanceSettings.tsx +++ b/frontend/src/app/(navfooter)/settings/appearance/AppearanceSettings.tsx @@ -45,7 +45,7 @@ export default function AppearanceSettings() { value={monospaceFont ?? ""} onChange={setMonospaceFont} placeholder="ui-monospace" - inputStyle={{ fontFamily: (monospaceFont ?? "ui-monospace") + ", monospace" }} + inputStyle={{ fontFamily: `${monospaceFont ?? "ui-monospace"}, monospace` }} />

diff --git a/frontend/src/app/(navfooter)/settings/layout.tsx b/frontend/src/app/(navfooter)/settings/layout.tsx index 1705587e0..188297b4f 100644 --- a/frontend/src/app/(navfooter)/settings/layout.tsx +++ b/frontend/src/app/(navfooter)/settings/layout.tsx @@ -8,7 +8,7 @@ export default function Layout({ children: React.ReactNode }) { return
-