Make code pass lint and check
This commit is contained in:
parent
a05cdb1d4d
commit
cc52506421
11 changed files with 41 additions and 39 deletions
|
@ -6,7 +6,7 @@
|
||||||
"dev": "vite dev",
|
"dev": "vite dev",
|
||||||
"build": "vite build",
|
"build": "vite build",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
"check": "svelte-kit sync && svelte-check --compiler-warnings \"css-unused-selector:ignore\" --tsconfig ./tsconfig.json",
|
||||||
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
||||||
"lint": "prettier --plugin-search-dir . --check . && eslint .",
|
"lint": "prettier --plugin-search-dir . --check . && eslint .",
|
||||||
"format": "prettier --plugin-search-dir . --write ."
|
"format": "prettier --plugin-search-dir . --write ."
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import type { PageServerLoad } from './$types';
|
import type { PageServerLoad } from './$types';
|
||||||
import { TSGhostContentAPI } from '@ts-ghost/content-api';
|
import { TSGhostContentAPI } from '@ts-ghost/content-api';
|
||||||
import Secrets from '$lib/server/secrets';
|
import Secrets from '$lib/server/secrets';
|
||||||
import { error, redirect } from '@sveltejs/kit';
|
import { error } from '@sveltejs/kit';
|
||||||
|
|
||||||
export const prerender = 'auto';
|
export const prerender = 'auto';
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ export const load: PageServerLoad = async ({ params }) => {
|
||||||
console.error(posts.errors);
|
console.error(posts.errors);
|
||||||
throw 'Not Found';
|
throw 'Not Found';
|
||||||
}
|
}
|
||||||
maxPage = Math.ceil((author.data.count!.posts || 0) / limit);
|
maxPage = Math.ceil((author.data.count?.posts || 0) / limit);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
throw error(404, 'Author not found');
|
throw error(404, 'Author not found');
|
||||||
}
|
}
|
||||||
|
|
|
@ -183,10 +183,6 @@
|
||||||
object-position: center;
|
object-position: center;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
> h1 {
|
|
||||||
//@include textStyleTitle;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,32 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
/* eslint svelte/no-at-html-tags: "off" */
|
||||||
import type { PageData } from './$types';
|
import type { PageData } from './$types';
|
||||||
import { DateTime } from 'luxon';
|
import { DateTime } from 'luxon';
|
||||||
import { Globe } from 'lucide-svelte';
|
import { Globe } from 'lucide-svelte';
|
||||||
import { fade, fly } from 'svelte/transition';
|
import { fly } from 'svelte/transition';
|
||||||
|
|
||||||
export let data: PageData;
|
export let data: PageData;
|
||||||
|
|
||||||
|
let ldJson = // The "<"-characters are seperated in this because otherwise the parser implodes
|
||||||
|
'<' +
|
||||||
|
'script type="application/ld+json">' +
|
||||||
|
JSON.stringify({
|
||||||
|
'@context': 'https://schema.org',
|
||||||
|
'@type': 'Article',
|
||||||
|
headline: data.post.title,
|
||||||
|
image: data.post.feature_image,
|
||||||
|
datePublished: data.post.published_at,
|
||||||
|
dateModified: data.post.updated_at,
|
||||||
|
author: data.post.authors?.map((author) => {
|
||||||
|
return {
|
||||||
|
'@type': 'Person',
|
||||||
|
name: author.name
|
||||||
|
};
|
||||||
|
})
|
||||||
|
}) +
|
||||||
|
'<' +
|
||||||
|
'/script>';
|
||||||
|
|
||||||
$: publishTime = DateTime.fromISO(data.post.published_at || data.post.created_at || '2001-11-03');
|
$: publishTime = DateTime.fromISO(data.post.published_at || data.post.created_at || '2001-11-03');
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -58,20 +79,7 @@
|
||||||
content={data.post.primary_tag.og_title || data.post.primary_tag.name}
|
content={data.post.primary_tag.og_title || data.post.primary_tag.name}
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
{@html `<script type="application/ld+json">${JSON.stringify({
|
{@html ldJson}
|
||||||
'@context': 'https://schema.org',
|
|
||||||
'@type': 'Article',
|
|
||||||
headline: data.post.title,
|
|
||||||
image: data.post.feature_image,
|
|
||||||
datePublished: data.post.published_at,
|
|
||||||
dateModified: data.post.updated_at,
|
|
||||||
author: data.post.authors?.map((author) => {
|
|
||||||
return {
|
|
||||||
'@type': 'Person',
|
|
||||||
name: author.name
|
|
||||||
};
|
|
||||||
})
|
|
||||||
})}</script>`}
|
|
||||||
</svelte:head>
|
</svelte:head>
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import type { PageServerLoad } from './$types';
|
import type { PageServerLoad } from './$types';
|
||||||
import { TSGhostContentAPI } from '@ts-ghost/content-api';
|
import { TSGhostContentAPI } from '@ts-ghost/content-api';
|
||||||
import Secrets from '$lib/server/secrets';
|
import Secrets from '$lib/server/secrets';
|
||||||
import { error, redirect } from '@sveltejs/kit';
|
import { error } from '@sveltejs/kit';
|
||||||
|
|
||||||
export const prerender = 'auto';
|
export const prerender = 'auto';
|
||||||
|
|
||||||
|
|
|
@ -174,10 +174,6 @@
|
||||||
width: 100%;
|
width: 100%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
color: white;
|
color: white;
|
||||||
|
|
||||||
> h1 {
|
|
||||||
//@include textStyleTitle;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,9 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
/* eslint svelte/no-at-html-tags: "off" */
|
||||||
import type { PageData } from './$types';
|
import type { PageData } from './$types';
|
||||||
import { DateTime } from 'luxon';
|
import { fly } from 'svelte/transition';
|
||||||
import { Globe } from 'lucide-svelte';
|
|
||||||
import { fade, fly } from 'svelte/transition';
|
|
||||||
|
|
||||||
export let data: PageData;
|
export let data: PageData;
|
||||||
|
|
||||||
$: publishTime = DateTime.fromISO(data.page.published_at || data.page.created_at || '2001-11-03');
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:head>
|
<svelte:head>
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { LayoutData } from './$types';
|
//import type { LayoutData } from './$types';
|
||||||
import '../app.scss';
|
import '../app.scss';
|
||||||
|
|
||||||
export let data: LayoutData;
|
//export let data: LayoutData;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="navigation">
|
<div class="navigation">
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
/* eslint svelte/no-at-html-tags: "off" */
|
||||||
import portrait from '../assets/portrait_smol.jpg';
|
import portrait from '../assets/portrait_smol.jpg';
|
||||||
import { siTelegram, siInstagram } from 'simple-icons';
|
import { siTelegram, siInstagram } from 'simple-icons';
|
||||||
import { Cake, MapPin, Nfc, Shirt } from 'lucide-svelte';
|
import { Cake, MapPin, Nfc, Shirt } from 'lucide-svelte';
|
||||||
|
@ -11,7 +12,7 @@
|
||||||
|
|
||||||
let portraitImg: HTMLImageElement | null = null;
|
let portraitImg: HTMLImageElement | null = null;
|
||||||
|
|
||||||
const performWoof = (i: number) => {
|
const performWoof = (/*i: number*/) => {
|
||||||
if (!portraitImg) return;
|
if (!portraitImg) return;
|
||||||
|
|
||||||
const picBoundingBox = portraitImg.getBoundingClientRect();
|
const picBoundingBox = portraitImg.getBoundingClientRect();
|
||||||
|
@ -254,6 +255,7 @@
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
-webkit-appearance: none;
|
-webkit-appearance: none;
|
||||||
-moz-appearance: none;
|
-moz-appearance: none;
|
||||||
|
appearance: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -307,6 +309,7 @@
|
||||||
cursor: default;
|
cursor: default;
|
||||||
-webkit-appearance: none;
|
-webkit-appearance: none;
|
||||||
-moz-appearance: none;
|
-moz-appearance: none;
|
||||||
|
appearance: none;
|
||||||
|
|
||||||
> img {
|
> img {
|
||||||
border-radius: 13px;
|
border-radius: 13px;
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { PageData } from './$types';
|
|
||||||
import bark from '$lib/bark';
|
import bark from '$lib/bark';
|
||||||
|
|
||||||
export let data: PageData;
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:head>
|
<svelte:head>
|
||||||
|
|
|
@ -15,7 +15,12 @@ const config = {
|
||||||
preserve: ['ld+json']
|
preserve: ['ld+json']
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
|
onwarn: (warning, handler) => {
|
||||||
|
if (warning.code == 'css-unused-selector') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
handler(warning);
|
||||||
|
},
|
||||||
kit: {
|
kit: {
|
||||||
// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
|
// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
|
||||||
// If your environment is not supported or you settled on a specific environment, switch out the adapter.
|
// If your environment is not supported or you settled on a specific environment, switch out the adapter.
|
||||||
|
|
Loading…
Add table
Reference in a new issue