diff --git a/.prettierrc b/.prettierrc index 6701bb1..0e6b46b 100644 --- a/.prettierrc +++ b/.prettierrc @@ -3,6 +3,7 @@ "singleQuote": false, "printWidth": 90, "plugins": ["prettier-plugin-svelte"], + "overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }], "semi": true, "svelteSortOrder": "options-styles-scripts-markup", "svelteStrictMode": false, diff --git a/bun.lockb b/bun.lockb index 2d477fe..46b545f 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..9e1c70f --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,37 @@ +import globals from "globals"; +import js from "@eslint/js"; +import eslintConfigPrettier from "eslint-config-prettier"; +import tsEslint from "typescript-eslint"; +import eslintPluginSvelte from "eslint-plugin-svelte"; +import svelteParser from "svelte-eslint-parser"; + +export default tsEslint.config( + js.configs.recommended, + ...tsEslint.configs.recommended, + ...eslintPluginSvelte.configs["flat/recommended"], + eslintConfigPrettier, + ...eslintPluginSvelte.configs["flat/prettier"], + { + files: ["**/*.svelte"], + languageOptions: { + ecmaVersion: 2022, + sourceType: "module", + globals: { ...globals.node, ...globals.browser }, + parser: svelteParser, + parserOptions: { + parser: tsEslint.parser, + extraFileExtensions: [".svelte"], + }, + }, + }, + { + ignores: [ + "**/.svelte-kit", + "**/.vercel", + "**/.yarn", + "**/build", + "**/node_modules", + "**/package", + ], + }, +); diff --git a/package.json b/package.json index 9111082..51440d8 100644 --- a/package.json +++ b/package.json @@ -8,29 +8,32 @@ "preview": "vite preview", "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", - "lint": "prettier --check . && eslint .", + "lint": "eslint './src/**/*.{js,ts,svelte}' --fix", "format": "prettier --write ." }, "devDependencies": { + "@eslint/js": "^9.0.0", "@sveltejs/adapter-auto": "^3.2.0", - "@sveltejs/kit": "^2.5.5", - "@sveltejs/vite-plugin-svelte": "^3.0.2", - "@typescript-eslint/eslint-plugin": "^7.5.0", - "@typescript-eslint/parser": "^7.5.0", + "@sveltejs/kit": "^2.5.6", + "@sveltejs/vite-plugin-svelte": "^3.1.0", "autoprefixer": "^10.4.19", "daisyui": "latest", "eslint": "^9.0.0", "eslint-config-prettier": "^9.1.0", - "eslint-plugin-svelte": "^2.36.0", + "eslint-plugin-svelte": "^2.37.0", + "globals": "^15.0.0", "postcss": "^8.4.38", "prettier": "^3.2.5", "prettier-plugin-svelte": "^3.2.3", - "svelte": "^4.2.12", + "svelte": "^4.2.15", "svelte-check": "^3.6.9", + "svelte-eslint-parser": "^0.34.1", + "svelte-preprocess": "^5.1.4", "tailwindcss": "^3.4.3", "tslib": "^2.6.2", - "typescript": "^5.4.4", - "vite": "^5.2.8" + "typescript": "^5.4.5", + "typescript-eslint": "^7.7.0", + "vite": "^5.2.9" }, "type": "module" } diff --git a/src/components/countdown.svelte b/src/components/countdown.svelte index 2ed3341..da7322b 100644 --- a/src/components/countdown.svelte +++ b/src/components/countdown.svelte @@ -2,7 +2,7 @@ import { onMount } from "svelte"; const GRADUATION = new Date(1753797600000).valueOf(); - let interval: NodeJS.Timer; + let interval: ReturnType; let timeTo = Math.abs(GRADUATION - Date.now().valueOf()) / 1000; diff --git a/src/routes/api/healthcheck/+server.ts b/src/routes/api/healthcheck/+server.ts index ef99279..3f8b648 100644 --- a/src/routes/api/healthcheck/+server.ts +++ b/src/routes/api/healthcheck/+server.ts @@ -1,5 +1,3 @@ -import type { RequestHandler } from "./$types"; - -export const GET: RequestHandler = ({ url }) => { +export function GET() { return new Response(); -}; +} diff --git a/svelte.config.js b/svelte.config.js index 84b8c1a..d9c597d 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -1,11 +1,11 @@ import adapter from "@sveltejs/adapter-auto"; -import { vitePreprocess } from "@sveltejs/vite-plugin-svelte"; +import sveltePreprocess from "svelte-preprocess"; /** @type {import('@sveltejs/kit').Config} */ const config = { // Consult https://kit.svelte.dev/docs/integrations#preprocessors // for more information about preprocessors - preprocess: vitePreprocess(), + preprocess: sveltePreprocess(), kit: { // adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.