From 74742ae61be0933bbabdf76a6f426848551711f0 Mon Sep 17 00:00:00 2001 From: ThetaDev Date: Mon, 13 May 2024 14:18:21 +0200 Subject: [PATCH 1/5] ci: fix tag fetching --- .forgejo/workflows/ci.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.forgejo/workflows/ci.yaml b/.forgejo/workflows/ci.yaml index 731a1f8..4d771bd 100644 --- a/.forgejo/workflows/ci.yaml +++ b/.forgejo/workflows/ci.yaml @@ -45,6 +45,8 @@ jobs: steps: - name: 👁️ Checkout repository uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: 📦 pnpm install run: pnpm install @@ -65,7 +67,7 @@ jobs: run: | { echo 'CHANGELOG<> "$GITHUB_ENV" - name: 🎉 Publish release From 009729b877e4f050fa0d1159aaa86dd43d534621 Mon Sep 17 00:00:00 2001 From: ThetaDev Date: Mon, 13 May 2024 23:33:35 +0200 Subject: [PATCH 2/5] fix: update ESLint config and fix lints --- .dockerignore | 4 +++- .gitignore | 3 +++ eslint.config.js | 14 ++++++++---- package.json | 2 +- src/app.d.ts | 4 +++- src/hooks.client.ts | 2 +- src/hooks.server.ts | 4 ++-- src/lib/components/filter/Autocomplete.svelte | 9 ++++---- src/lib/components/filter/FilterBar.svelte | 8 +++---- src/lib/components/filter/FilterChip.svelte | 4 ++-- src/lib/components/filter/filters.ts | 2 +- src/lib/components/filter/types.ts | 4 +++- src/lib/components/table/SortHeader.svelte | 2 +- src/lib/components/ui/WeekSelector.svelte | 2 +- src/lib/server/auth.ts | 2 +- src/lib/server/query/util.ts | 5 +++-- src/lib/server/trpc/context.ts | 4 +--- src/lib/server/trpc/router.ts | 8 ------- src/lib/shared/util/date.ts | 2 +- src/lib/shared/util/util.ts | 4 ++-- src/routes/+layout.server.ts | 2 +- vite.config.js => vite.config.ts | 22 +++++++++++-------- 22 files changed, 61 insertions(+), 52 deletions(-) rename vite.config.js => vite.config.ts (79%) diff --git a/.dockerignore b/.dockerignore index 91f5648..62669bc 100644 --- a/.dockerignore +++ b/.dockerignore @@ -4,6 +4,8 @@ node_modules /package .env .env.* -!.env.example +.eslintcache vite.config.js.timestamp-* vite.config.ts.timestamp-* +vitest.config.*.js.timestamp-* +vitest.config.*.ts.timestamp-* diff --git a/.gitignore b/.gitignore index cdc9c6b..ffc5dfa 100644 --- a/.gitignore +++ b/.gitignore @@ -4,5 +4,8 @@ node_modules /.svelte-kit /package .env +.eslintcache vite.config.js.timestamp-* vite.config.ts.timestamp-* +vitest.config.*.js.timestamp-* +vitest.config.*.ts.timestamp-* diff --git a/eslint.config.js b/eslint.config.js index 9421a96..3d6696e 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -14,7 +14,7 @@ import ts from "typescript-eslint"; export default [ js.configs.recommended, - ...ts.configs.recommended, + ...ts.configs.recommendedTypeChecked, ...svelte.configs["flat/recommended"], // TS-Svelte { @@ -585,10 +585,16 @@ export default [ }, ], "@typescript-eslint/return-await": "error", - "@typescript-eslint/no-shadow": ["error", { allow: ["i", "j"] }], "no-shadow-restricted-names": "error", - "@typescript-eslint/no-loss-of-precision": "error", + "@typescript-eslint/promise-function-async": "error", + "@typescript-eslint/no-base-to-string": "off", + + // these clash with Svelte generics + "@typescript-eslint/no-unsafe-assignment": "off", + "@typescript-eslint/no-unsafe-call": "off", + "@typescript-eslint/no-unsafe-argument": "off", + "@typescript-eslint/no-unsafe-member-access": "off", }, }, @@ -812,7 +818,7 @@ export default [ ".svelte-kit/", "*.config.cjs", "vite.config.js.timestamp-*", - "vite.config.ts.timestamp-*", + "vitest.config.*.timestamp-*", ".tmp/", ], }, diff --git a/package.json b/package.json index 89c0900..61fcd29 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "test": "vitest --run && vitest --config vitest.config.integration.js --run", "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", - "lint": "eslint . --max-warnings=0", + "lint": "eslint . --max-warnings=0 --cache", "format": "eslint . --fix", "test:unit": "vitest", "test:integration": "vitest --config vitest.config.integration.js", diff --git a/src/app.d.ts b/src/app.d.ts index 13a994c..b86d0aa 100644 --- a/src/app.d.ts +++ b/src/app.d.ts @@ -8,7 +8,9 @@ declare global { interface Locals { session: Session | null; } - // interface PageData {} + interface PageData { + session: Session | null; + } // interface Platform {} } diff --git a/src/hooks.client.ts b/src/hooks.client.ts index 4aac5a8..4cc17f9 100644 --- a/src/hooks.client.ts +++ b/src/hooks.client.ts @@ -3,7 +3,7 @@ import { TRPCClientError } from "@trpc/client"; const CHECK_CONNECTION = "Die Seite konnte nicht geladen werden, prüfen sie ihre Verbindung"; -export const handleError: HandleClientError = async ({ error, message, status }) => { +export const handleError: HandleClientError = ({ error, message, status }) => { // If there are client-side errors, SvelteKit always returns the nondescript // "Internal error" message. The most common errors should be mapped to a more // detailed description diff --git a/src/hooks.server.ts b/src/hooks.server.ts index 9a0c57d..a7fddf5 100644 --- a/src/hooks.server.ts +++ b/src/hooks.server.ts @@ -33,5 +33,5 @@ export const handle = sequence( ); // Allow server application to exit -process.on("SIGINT", process.exit); // Ctrl+C -process.on("SIGTERM", process.exit); // docker stop +process.on("SIGINT", () => process.exit()); // Ctrl+C +process.on("SIGTERM", () => process.exit()); // docker stop diff --git a/src/lib/components/filter/Autocomplete.svelte b/src/lib/components/filter/Autocomplete.svelte index 9009450..f1a7885 100644 --- a/src/lib/components/filter/Autocomplete.svelte +++ b/src/lib/components/filter/Autocomplete.svelte @@ -1,8 +1,9 @@ -