fix(frontend): actually show eslint errors in vscode, fix eslint errors

This commit is contained in:
sam 2025-04-17 15:29:55 +02:00
parent a89a5b3494
commit bcdb2f9540
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
8 changed files with 22 additions and 3 deletions

View file

@ -4,5 +4,6 @@
"i18n-ally.localesPaths": ["src/lib/i18n", "src/lib/i18n/locales"],
"i18n-ally.keystyle": "nested",
"explorer.sortOrder": "filesFirst",
"explorer.compactFolders": false
"explorer.compactFolders": false,
"eslint.validate": ["javascript", "javascriptreact", "svelte"]
}

View file

@ -34,6 +34,7 @@
{#if renderNotice}
<div class="alert alert-light" role="alert">
<div>
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
{@html renderedMessage}
</div>
{#if canDismiss}

View file

@ -59,6 +59,7 @@
{#if reason}
<details>
<summary>Reason</summary>
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
{@html reason}
</details>
{:else}

View file

@ -29,6 +29,7 @@
<h4>Reason</h4>
<p>
{#if entry.reason}
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
{@html renderMarkdown(entry.reason)}
{:else}
<em class="text-secondary">(no reason given)</em>

View file

@ -296,7 +296,8 @@
"custom-preference-notice": "Want to edit your custom preferences?",
"custom-preference-notice-link": "Go to settings",
"crop-avatar-header": "Crop avatar",
"crop-avatar-button": "Crop"
"crop-avatar-button": "Crop",
"max-custom-preferences": "You have reached the maximum amount of custom preferences ({{current}}/{{max}}), and cannot add new ones."
},
"cancel": "Cancel",
"report": {

View file

@ -56,6 +56,7 @@
<h3>Context</h3>
<p>
{#if report.context}
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
{@html renderMarkdown(report.context)}
{:else}
<em>(no context given)</em>

View file

@ -18,5 +18,6 @@
</svelte:head>
<div class="container">
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
{@html md}
</div>

View file

@ -7,6 +7,7 @@
import { t } from "$lib/i18n";
import log from "$lib/log";
import type { PageData } from "./$types";
import InfoCircleFill from "svelte-bootstrap-icons/lib/InfoCircleFill.svelte";
type Props = { data: PageData };
let { data }: Props = $props();
@ -84,8 +85,19 @@
{$t("settings.custom-preferences-title")}
<div class="btn-group">
<button class="btn btn-primary" onclick={() => save()}>{$t("save-changes")}</button>
<button class="btn btn-success" onclick={add}>{$t("editor.add-custom-preference")}</button>
<button class="btn btn-success" onclick={add} disabled={!canAdd}
>{$t("editor.add-custom-preference")}</button
>
</div>
{#if !canAdd}
<div>
<InfoCircleFill aria-hidden />
{$t("editor.max-custom-preferences", {
current: customPreferences.length,
max: data.meta.limits.custom_preferences,
})}
</div>
{/if}
</h3>
<FormStatusMarker form={ok} />