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.localesPaths": ["src/lib/i18n", "src/lib/i18n/locales"],
"i18n-ally.keystyle": "nested", "i18n-ally.keystyle": "nested",
"explorer.sortOrder": "filesFirst", "explorer.sortOrder": "filesFirst",
"explorer.compactFolders": false "explorer.compactFolders": false,
"eslint.validate": ["javascript", "javascriptreact", "svelte"]
} }

View file

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

View file

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

View file

@ -29,6 +29,7 @@
<h4>Reason</h4> <h4>Reason</h4>
<p> <p>
{#if entry.reason} {#if entry.reason}
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
{@html renderMarkdown(entry.reason)} {@html renderMarkdown(entry.reason)}
{:else} {:else}
<em class="text-secondary">(no reason given)</em> <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": "Want to edit your custom preferences?",
"custom-preference-notice-link": "Go to settings", "custom-preference-notice-link": "Go to settings",
"crop-avatar-header": "Crop avatar", "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", "cancel": "Cancel",
"report": { "report": {

View file

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

View file

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

View file

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