Skip to content

Commit 92bc838

Browse files
committed
style: install prettier
1 parent 514afc7 commit 92bc838

20 files changed

+112
-69
lines changed

.prettierrc

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
plugins:
2+
- prettier-plugin-svelte
3+
overrides:
4+
- files: "*.svelte"
5+
options:
6+
parser: "svelte"

bun.lock

+6
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
"@cloudflare/workers-types": "^4.20250204.0",
1212
"@types/bun": "^1.2.4",
1313
"lefthook": "^1.10.10",
14+
"prettier": "^3.5.2",
15+
"prettier-plugin-svelte": "^3.3.3",
1416
},
1517
"peerDependencies": {
1618
"typescript": "^5.0.0",
@@ -786,6 +788,10 @@
786788

787789
"prebuild-install": ["[email protected]", "", { "dependencies": { "detect-libc": "^2.0.0", "expand-template": "^2.0.3", "github-from-package": "0.0.0", "minimist": "^1.2.3", "mkdirp-classic": "^0.5.3", "napi-build-utils": "^2.0.0", "node-abi": "^3.3.0", "pump": "^3.0.0", "rc": "^1.2.7", "simple-get": "^4.0.0", "tar-fs": "^2.0.0", "tunnel-agent": "^0.6.0" }, "bin": { "prebuild-install": "bin.js" } }, "sha512-8Mf2cbV7x1cXPUILADGI3wuhfqWvtiLA1iclTDbFRZkgRQS0NqsPZphna9V+HyTEadheuPmjaJMsbzKQFOzLug=="],
788790

791+
"prettier": ["[email protected]", "", { "bin": { "prettier": "bin/prettier.cjs" } }, "sha512-lc6npv5PH7hVqozBR7lkBNOGXV9vMwROAPlumdBkX0wTbbzPu/U1hk5yL8p2pt4Xoc+2mkT8t/sow2YrV/M5qg=="],
792+
793+
"prettier-plugin-svelte": ["[email protected]", "", { "peerDependencies": { "prettier": "^3.0.0", "svelte": "^3.2.0 || ^4.0.0-next.0 || ^5.0.0-next.0" } }, "sha512-yViK9zqQ+H2qZD1w/bH7W8i+bVfKrD8GIFjkFe4Thl6kCT9SlAsXVNmt3jCvQOCsnOhcvYgsoVlRV/Eu6x5nNw=="],
794+
789795
"printable-characters": ["[email protected]", "", {}, "sha512-dKp+C4iXWK4vVYZmYSd0KBH5F/h1HoZRsbJ82AVKRO3PEo8L4lBS/vLwhVtpwwuYcoIsVY+1JYKR268yn480uQ=="],
790796

791797
"prism-svelte": ["[email protected]", "", {}, "sha512-yABh19CYbM24V7aS7TuPYRNMqthxwbvx6FF/Rw920YbyBWO3tnyPIqRMgHuSVsLmuHkkBS1Akyof463FVdkeDQ=="],

flake.lock

+1-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+8-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
"name": "how-match",
33
"type": "module",
44
"private": true,
5-
"workspaces": ["share", "service", "web"],
5+
"workspaces": [
6+
"share",
7+
"service",
8+
"web"
9+
],
610
"scripts": {
711
"prepare": "bun sync && bun prepare:self",
812
"prepare:self": "lefthook install",
@@ -23,7 +27,9 @@
2327
"@biomejs/biome": "^1.9.4",
2428
"@cloudflare/workers-types": "^4.20250204.0",
2529
"@types/bun": "^1.2.4",
26-
"lefthook": "^1.10.10"
30+
"lefthook": "^1.10.10",
31+
"prettier": "^3.5.2",
32+
"prettier-plugin-svelte": "^3.3.3"
2733
},
2834
"peerDependencies": {
2935
"typescript": "^5.0.0"

service/routes/projects/index.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,13 @@ const route = new Hono<HonoOptions>()
245245
});
246246
return acc;
247247
},
248-
{} as Record<string, { role_name: string; participants: { participant_id: string; participant_name: string }[] }>,
248+
{} as Record<
249+
string,
250+
{
251+
role_name: string;
252+
participants: { participant_id: string; participant_name: string }[];
253+
}
254+
>,
249255
);
250256
return c.json({
251257
participantsOnEachRole,

service/routes/projects/preferences.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@ const route = new Hono<HonoOptions>()
5050
})
5151
.returning()
5252
)[0];
53-
if (!participant) throw new HTTPException(500, { message: "failed to insert participant" });
53+
if (!participant)
54+
throw new HTTPException(500, {
55+
message: "failed to insert participant",
56+
});
5457

5558
await db(c)
5659
.insert(ratings)

service/tsconfig.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
// Some stricter flags (disabled by default)
2424
"noUnusedLocals": false,
2525
"noUnusedParameters": false,
26-
"noPropertyAccessFromIndexSignature": false,
26+
"noPropertyAccessFromIndexSignature": false
2727
},
28-
"include": ["**/*.ts", "worker-configuration.d.ts"],
28+
"include": ["**/*.ts", "worker-configuration.d.ts"]
2929
}

share/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"extends": "../tsconfig.json",
2+
"extends": "../tsconfig.json"
33
}

tsconfig.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
"noUncheckedIndexedAccess": true,
2929
"paths": {
3030
"$features": ["./src/features"],
31-
"$features/*": ["./src/features/*"],
32-
},
31+
"$features/*": ["./src/features/*"]
32+
}
3333
},
34-
"exclude": ["node_modules"],
34+
"exclude": ["node_modules"]
3535
}

web/src/app.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@
2424

2525
.hm-block {
2626
@apply rounded-lg bg-white p-6 flex flex-col gap-2;
27-
}
27+
}

web/src/app.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en" class="h-full">
33
<head>
44
<meta charset="utf-8" />

web/src/components/header.svelte

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
let { title } = $props();
33
</script>
44

5-
<header class="sticky top-0 left-0 w-full z-30 border-b border-primary bg-white">
5+
<header
6+
class="sticky top-0 left-0 w-full z-30 border-b border-primary bg-white"
7+
>
68
<div class="h-12 px-6 gap-8 flex items-center align-middle">
79
<a class="font-bold text-xl cursor-pointer" href="/">how-match</a>
810
<span class="text-xl">

web/src/routes/+page.svelte

+42-33
Original file line numberDiff line numberDiff line change
@@ -44,42 +44,51 @@ onMount(() => {
4444
</div>
4545
</section>
4646
<section>
47-
{#if !projects}
48-
<span>Welcome! this is being prerendered.</span>
49-
{:else}
50-
<ul class="list w-full bg-base-200 rounded-box shadow-md">
51-
<li class="p-4 pb-2 text-xl opacity-60 tracking-wide">
52-
作成・提出したプロジェクト
53-
</li>
54-
{#if projects.length === 0}
55-
<li class="list-row flex">
56-
作成・提出したプロジェクトはありません。
47+
{#if !projects}
48+
<span>Welcome! this is being prerendered.</span>
49+
{:else}
50+
<ul class="list w-full bg-base-200 rounded-box shadow-md">
51+
<li class="p-4 pb-2 text-xl opacity-60 tracking-wide">
52+
作成・提出したプロジェクト
5753
</li>
58-
{:else}
59-
{#each projects as project}
54+
{#if projects.length === 0}
6055
<li class="list-row flex">
61-
<span class="h-full flex-1">{project.name}</span>
62-
{#if project.is_admin}
63-
<a class="btn btn-primary btn-sm btn-outline" href="/{project.id}/config">
64-
管理
65-
</a>
66-
{/if}
67-
{#if project.closed_at !== null && new Date(project.closed_at).getTime() < new Date().getTime()}
68-
<!-- 締切済み -->
69-
<a class="btn btn-success btn-sm" href="/{project.id}/result">
70-
結果
71-
</a>
72-
{:else}
73-
<a class="btn btn-primary btn-sm" href="/{project.id}/submit">
74-
提出
75-
</a>
76-
{/if}
56+
作成・提出したプロジェクトはありません。
7757
</li>
78-
{/each}
79-
{/if}
80-
</ul>
81-
{/if}
82-
</section>
58+
{:else}
59+
{#each projects as project}
60+
<li class="list-row flex">
61+
<span class="h-full flex-1">{project.name}</span>
62+
{#if project.is_admin}
63+
<a
64+
class="btn btn-primary btn-sm btn-outline"
65+
href="/{project.id}/config"
66+
>
67+
管理
68+
</a>
69+
{/if}
70+
{#if project.closed_at !== null && new Date(project.closed_at).getTime() < new Date().getTime()}
71+
<!-- 締切済み -->
72+
<a
73+
class="btn btn-success btn-sm"
74+
href="/{project.id}/result"
75+
>
76+
結果
77+
</a>
78+
{:else}
79+
<a
80+
class="btn btn-primary btn-sm"
81+
href="/{project.id}/submit"
82+
>
83+
提出
84+
</a>
85+
{/if}
86+
</li>
87+
{/each}
88+
{/if}
89+
</ul>
90+
{/if}
91+
</section>
8392
</div>
8493
</div>
8594
</div>

web/src/routes/[projectId]/config/+page.svelte

+4-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,10 @@ onMount(() => {
127127
締め切る
128128
</button>
129129
{#if project.closed_at}
130-
<a class="btn btn-primary btn-soft m-4" href={`/${project.id}/result`}>
130+
<a
131+
class="btn btn-primary btn-soft m-4"
132+
href={`/${project.id}/result`}
133+
>
131134
結果を見る
132135
</a>
133136
{/if}

web/src/routes/[projectId]/config/+page.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ export const load: PageLoad = ({ params, fetch }) => {
1313
})
1414
.then(async (res) => {
1515
if (res.ok) return { ok: true, data: await res.json() } as const;
16-
return { ok: false, code: res.status, message: await res.text() } as const;
16+
return {
17+
ok: false,
18+
code: res.status,
19+
message: await res.text(),
20+
} as const;
1721
});
1822

1923
return {

web/src/routes/[projectId]/result/+page.svelte

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ onDestroy(() => clearInterval(interval));
2727
{:else}
2828
{@const result = res.data}
2929
<div class="hm-block">
30-
<h2 class="text-xl">{result.projectName}</h2>
31-
<p>{result.projectDesc}</p>
32-
</div>
30+
<h2 class="text-xl">{result.projectName}</h2>
31+
<p>{result.projectDesc}</p>
32+
</div>
3333
{#each Object.entries(result.participantsOnEachRole) as [_roleId, role]}
3434
<div class="hm-block">
3535
<h2>{role.role_name}</h2>

web/src/routes/[projectId]/result/+page.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ export const load: PageLoad = ({ params, fetch }) => {
2626
})
2727
.then(async (res) => {
2828
if (res.ok) return { ok: true, data: await res.json() } as const;
29-
return { ok: false, code: res.status, message: await res.text() } as const;
29+
return {
30+
ok: false,
31+
code: res.status,
32+
message: await res.text(),
33+
} as const;
3034
});
3135

3236
return {

web/src/routes/[projectId]/submit/+page.svelte

+6-6
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,7 @@ const resultLink = $derived(
7474
{#if closed}
7575
<div role="alert" class="alert alert-error m-6">
7676
既に締め切られています
77-
<a class="btn btn-primary" href={resultLink}>
78-
結果を見る
79-
</a>
77+
<a class="btn btn-primary" href={resultLink}> 結果を見る </a>
8078
</div>
8179
{/if}
8280
{#if project === null}
@@ -108,7 +106,7 @@ const resultLink = $derived(
108106
disabled={closed}
109107
/>
110108
</div>
111-
<RolesSelector bind:ratings {closed}/>
109+
<RolesSelector bind:ratings {closed} />
112110
<div class="flex justify-end">
113111
{#if closed}
114112
<button type="submit" class="btn btn-primary" disabled>
@@ -120,11 +118,13 @@ const resultLink = $derived(
120118
</button>
121119
{:else if formState === "submitting"}
122120
<button type="submit" class="btn btn-primary" disabled>
123-
<span class="loading loading-spinner"></span> {formVerb}中...
121+
<span class="loading loading-spinner"></span>
122+
{formVerb}中...
124123
</button>
125124
{:else if formState === "error"}
126125
<button type="submit" class="btn btn-primary" disabled>
127-
<span class="loading loading-spinner"></span> {formVerb}に失敗しました
126+
<span class="loading loading-spinner"></span>
127+
{formVerb}に失敗しました
128128
</button>
129129
{:else if formState === "done"}
130130
<button type="submit" class="btn btn-primary" disabled>

web/src/routes/[projectId]/submit/roles-selector.svelte

+2-6
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,9 @@ const { ratings = $bindable(), closed }: Props = $props();
1212

1313
{#each ratings as rating, radioIndex (radioIndex)}
1414
{@const role = rating.role}
15-
<div
16-
class="hm-block"
17-
>
15+
<div class="hm-block">
1816
<h3>役職:{role.name}</h3>
19-
<div
20-
class="gap-2 grid grid-cols-7 justify-items-center text-sm"
21-
>
17+
<div class="gap-2 grid grid-cols-7 justify-items-center text-sm">
2218
<div></div>
2319
<div class="text-lg">1</div>
2420
<div class="text-lg">2</div>

web/tsconfig.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"extends": ["../tsconfig.json", "./.svelte-kit/tsconfig.json"],
33
"compilerOptions": {
44
"noEmit": true,
5-
"moduleResolution": "bundler",
6-
},
5+
"moduleResolution": "bundler"
6+
}
77
// Path aliases are handled by https://svelte.dev/docs/kit/configuration#alias
88
// except $lib which is handled by https://svelte.dev/docs/kit/configuration#files
99
//

0 commit comments

Comments
 (0)