From 1b6a68a036f63e1581f594e5ab607d24357bcd54 Mon Sep 17 00:00:00 2001 From: Reinaldy Rafli Date: Sat, 10 Sep 2022 20:33:58 +0700 Subject: [PATCH] format: run prettier --- client/src/hooks.server.ts | 10 +++++----- client/src/languages/en.json | 2 +- client/src/languages/id.json | 2 +- client/src/routes/+page.server.ts | 26 ++++++++++++-------------- client/src/routes/+page.ts | 2 +- client/svelte.config.js | 4 ++-- client/tsconfig.json | 4 ++-- client/vite.config.ts | 3 +-- 8 files changed, 25 insertions(+), 28 deletions(-) diff --git a/client/src/hooks.server.ts b/client/src/hooks.server.ts index 52c43b6..54c38f3 100644 --- a/client/src/hooks.server.ts +++ b/client/src/hooks.server.ts @@ -1,7 +1,7 @@ -import type { Handle } from "@sveltejs/kit"; +import type { Handle } from '@sveltejs/kit'; export const handle: Handle = ({ event, resolve }) => { - return resolve(event, { - transformPageChunk: ({ html }) => html.replace('%lang%', "en") - }); -} \ No newline at end of file + return resolve(event, { + transformPageChunk: ({ html }) => html.replace('%lang%', 'en'), + }); +}; diff --git a/client/src/languages/en.json b/client/src/languages/en.json index 5fcbc94..2125793 100644 --- a/client/src/languages/en.json +++ b/client/src/languages/en.json @@ -108,4 +108,4 @@ "3": "Do some error handling if the request fails" } } -} \ No newline at end of file +} diff --git a/client/src/languages/id.json b/client/src/languages/id.json index f464e47..e1135f9 100644 --- a/client/src/languages/id.json +++ b/client/src/languages/id.json @@ -108,4 +108,4 @@ "3": "Periksa dan jangan abaikan errornya jika request gagal" } } -} \ No newline at end of file +} diff --git a/client/src/routes/+page.server.ts b/client/src/routes/+page.server.ts index 5be5165..7c38366 100644 --- a/client/src/routes/+page.server.ts +++ b/client/src/routes/+page.server.ts @@ -1,21 +1,19 @@ -import { $fetch } from "ohmyfetch"; -import env from "../lib/env"; +import { $fetch } from 'ohmyfetch'; +import env from '../lib/env'; interface TotalResponse { - message: number; + message: number; } /** @type {import('./$types').PageServerLoad} */ export async function load() { - const response = await $fetch( - "total", - { - method: "GET", - baseURL: env.API_ENDPOINT, - parseResponse: JSON.parse - }); + const response = await $fetch('total', { + method: 'GET', + baseURL: env.API_ENDPOINT, + parseResponse: JSON.parse, + }); - return { - total: response.message - } -} \ No newline at end of file + return { + total: response.message, + }; +} diff --git a/client/src/routes/+page.ts b/client/src/routes/+page.ts index ee82859..77ab0a0 100644 --- a/client/src/routes/+page.ts +++ b/client/src/routes/+page.ts @@ -1 +1 @@ -export const ssr = true; \ No newline at end of file +export const ssr = true; diff --git a/client/svelte.config.js b/client/svelte.config.js index 9f77f0c..29f8fc7 100644 --- a/client/svelte.config.js +++ b/client/svelte.config.js @@ -22,12 +22,12 @@ const config = { assets: './static', hooks: { server: './src', - client: './src' + client: './src', }, lib: './src/lib', }, adapter: adapter({ - out: "dist" + out: 'dist', }), }, }; diff --git a/client/tsconfig.json b/client/tsconfig.json index 775ee73..f5abbb1 100644 --- a/client/tsconfig.json +++ b/client/tsconfig.json @@ -24,8 +24,8 @@ "allowJs": true, "checkJs": true, "paths": { - "$lib":["src/lib"], - "$lib/*":["src/lib/*"] + "$lib": ["src/lib"], + "$lib/*": ["src/lib/*"] } }, "include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.ts", "src/**/*.svelte"] diff --git a/client/vite.config.ts b/client/vite.config.ts index 206b681..2e920e4 100644 --- a/client/vite.config.ts +++ b/client/vite.config.ts @@ -2,6 +2,5 @@ import { sveltekit } from '@sveltejs/kit/vite'; import { defineConfig } from 'vite'; export default defineConfig({ - plugins: [sveltekit()], - + plugins: [sveltekit()], });