Closed SachsenspieltCoding closed 1 year ago
Es gibt jetzt einen ESLint und Svelte Check bei jedem PR. Diese spucken momentan noch Fehler, diese sollten primär zu berücksichtigen
Svelte Check
$ svelte-kit sync && svelte-check --tsconfig ./tsconfig.json
====================================
Loading svelte-check in workspace: /mnt/DevDisk/CUBYX/website
Getting Svelte diagnostics...
/mnt/DevDisk/CUBYX/website/src/components/Common/HeroWithTitleAndSlogan.svelte:7:12
Error: Type '{ img: string; "}": true; }' is not assignable to type '{ img: string; alt: string; rounded?: boolean | undefined; }'.
Object literal may only specify known properties, and '"}"' does not exist in type '{ img: string; alt: string; rounded?: boolean | undefined; }'. (ts)
<Hero {img}}>
<div class="dshadow text-center leading-[2rem] md:leading-[3rem] lg:leading-[4rem]">
/mnt/DevDisk/CUBYX/website/src/components/Footer/FooterLegal.svelte:13:3
Warn: Unknown at rule @apply (css)
p {
@apply text-neutral-focus;
}
/mnt/DevDisk/CUBYX/website/src/components/Header/HeaderArrow.svelte:12:29
Error: Type 'string' is not assignable to type 'number'. (ts)
>
<Icon data={faChevronLeft} scale="2" />
<Icon data={faChevronLeft} scale="3" />
/mnt/DevDisk/CUBYX/website/src/components/Header/HeaderArrow.svelte:13:29
Error: Type 'string' is not assignable to type 'number'. (ts)
<Icon data={faChevronLeft} scale="2" />
<Icon data={faChevronLeft} scale="3" />
</div>
/mnt/DevDisk/CUBYX/website/src/components/Header/HeaderLogo.svelte:4:13
Error: Variable 'rotateDown' implicitly has type 'any' in some locations where its type cannot be determined. (js)
export let rotateDown;
</script>
/mnt/DevDisk/CUBYX/website/src/components/Header/HeaderLogo.svelte:8:25
Error: Variable 'rotateDown' implicitly has an 'any' type. (js)
<div class="flex w-max items-center justify-center gap-5">
<HeaderArrow rotation={rotateDown ? 270 : 180} largeRotation="0" />
<img src="/img/logo/netzwerk.png" alt="Cubyx Netzwerk Logo" class="w-20" />
/mnt/DevDisk/CUBYX/website/src/components/Header/HeaderLogo.svelte:8:49
Error: Type 'string' is not assignable to type '0 | 90 | 180 | -90 | 270 | undefined'. (js)
<div class="flex w-max items-center justify-center gap-5">
<HeaderArrow rotation={rotateDown ? 270 : 180} largeRotation="0" />
<img src="/img/logo/netzwerk.png" alt="Cubyx Netzwerk Logo" class="w-20" />
/mnt/DevDisk/CUBYX/website/src/components/Header/HeaderLogo.svelte:10:25
Error: Variable 'rotateDown' implicitly has an 'any' type. (js)
<img src="/img/logo/netzwerk.png" alt="Cubyx Netzwerk Logo" class="w-20" />
<HeaderArrow rotation={rotateDown ? -90 : 0} largeRotation="180" />
</div>
/mnt/DevDisk/CUBYX/website/src/components/Header/HeaderLogo.svelte:10:47
Error: Type 'string' is not assignable to type '0 | 90 | 180 | -90 | 270 | undefined'. (js)
<img src="/img/logo/netzwerk.png" alt="Cubyx Netzwerk Logo" class="w-20" />
<HeaderArrow rotation={rotateDown ? -90 : 0} largeRotation="180" />
</div>
/mnt/DevDisk/CUBYX/website/src/components/Header/Header.svelte:9:6
Error: Variable 'leftLinks' implicitly has type 'any[]' in some locations where its type cannot be determined. (ts)
let leftLinks = [];
let rightLinks = [];
/mnt/DevDisk/CUBYX/website/src/components/Header/Header.svelte:10:6
Error: Variable 'rightLinks' implicitly has type 'any[]' in some locations where its type cannot be determined. (ts)
let leftLinks = [];
let rightLinks = [];
/mnt/DevDisk/CUBYX/website/src/components/Header/Header.svelte:25:10
Error: Variable 'leftLinks' implicitly has an 'any[]' type. (ts)
<HeaderLinkWrapper justify="end">
{#each leftLinks as link}
<HeaderLink link={link.link} text={link.text} />
/mnt/DevDisk/CUBYX/website/src/components/Header/Header.svelte:26:5
Error: Property 'onClick' is missing in type '{ link: any; text: any; }' but required in type '{ text: string; link: string; onClick: () => void; }'. (ts)
{#each leftLinks as link}
<HeaderLink link={link.link} text={link.text} />
{/each}
/mnt/DevDisk/CUBYX/website/src/components/Header/Header.svelte:30:3
Error: Property 'rotateDown' is missing in type '{}' but required in type '{ rotateDown: any; }'. (ts)
<HeaderLogo />
/mnt/DevDisk/CUBYX/website/src/components/Header/Header.svelte:33:10
Error: Variable 'rightLinks' implicitly has an 'any[]' type. (ts)
<HeaderLinkWrapper justify="start">
{#each rightLinks as link}
<HeaderLink link={link.link} text={link.text} />
/mnt/DevDisk/CUBYX/website/src/components/Header/Header.svelte:34:5
Error: Property 'onClick' is missing in type '{ link: any; text: any; }' but required in type '{ text: string; link: string; onClick: () => void; }'. (ts)
{#each rightLinks as link}
<HeaderLink link={link.link} text={link.text} />
{/each}
/mnt/DevDisk/CUBYX/website/src/components/Timeline/TimelineItem.svelte:2:16
Error: Module '"./Timeline.svelte"' has no exported member 'TimelineItemType'. Did you mean to use 'import TimelineItemType from "./Timeline.svelte"' instead? (ts)
<script lang="ts">
import type { TimelineItemType } from "./Timeline.svelte";
import { twMerge } from "tailwind-merge";
/mnt/DevDisk/CUBYX/website/src/components/Timeline/Timeline.svelte:5:2
Error: Modifiers cannot appear here.
If this is a declare statement, move it into <script context="module">..</script> (ts)
export type TimelineItemType = {
title: string;
/mnt/DevDisk/CUBYX/website/src/components/Timeline/AboutTimeline.svelte:39:12
Error: Type '{ title: string; date: string; position: string; }[]' is not assignable to type 'TimelineItemType[]'.
Property 'description' is missing in type '{ title: string; date: string; position: string; }' but required in type 'TimelineItemType'. (js)
<div class="m-auto flex w-full justify-center p-8">
<Timeline items={items.reverse()} />
</div>
/mnt/DevDisk/CUBYX/website/src/routes/+error.svelte:20:37
Error: '$page.error' is possibly 'null'. (js)
<h1>Fehler {$page.status}</h1>
<h4 class="text-grayedOut_dark">{$page.error.message}</h4>
</div>
/mnt/DevDisk/CUBYX/website/src/routes/+page.svelte:9:13
Warn: Component has unused export property 'data'. If it is for external reference only, please consider using `export const data` (svelte)
export let data: PageData;
</script>
====================================
svelte-check found 19 errors and 2 warnings in 10 files
error: script "check" exited with code 1 (SIGHUP)
Lint:
$ prettier --check . && eslint .
Checking formatting...
.eslintrc.cjs
🌼 daisyUI 3.7.7 https://daisyui.com
╰╮
╰─ ✔︎ [ 1 ] theme is enabled. You can add more themes or make your own theme:
https://daisyui.com/docs/themes
❤︎ Support daisyUI: https://opencollective.com/daisyui
All matched files use Prettier code style!
/mnt/DevDisk/CUBYX/website/src/routes/+page.svelte
9:13 error Component has unused export property 'data'. If it is for external reference only, please consider using `export const data`(unused-export-let) svelte/valid-compile
✖ 1 problem (1 error, 0 warnings)
error: script "lint" exited with code 1 (SIGHUP)
Da WebStorm jetzt konrekter Fehler in SvelteKit anzeigt, sollte dies etwas überarbeitet werden, sodass die IDE nicht rummeckert.