Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"editor.codeActionsOnSave": {
"source.fixAll": true
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.defaultFormatter": "oxc.oxc-vscode",
"editor.formatOnSave": true,
"editor.formatOnPaste": false,
"editor.quickSuggestions": {
Expand All @@ -67,13 +67,13 @@
"files.trimFinalNewlines": true,
"files.trimTrailingWhitespace": true,
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
"editor.defaultFormatter": "oxc.oxc-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
"editor.defaultFormatter": "oxc.oxc-vscode"
},
"[svelte]": {
"editor.defaultFormatter": "svelte.svelte-vscode"
"editor.defaultFormatter": "oxc.oxc-vscode"
},
"[prisma]": {
"editor.defaultFormatter": "Prisma.prisma"
Expand All @@ -90,10 +90,10 @@
"christian-kohler.path-intellisense",
"csstools.postcss",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"formulahendry.auto-rename-tag",
"ms-playwright.playwright",
"openai.chatgpt",
"oxc.oxc-vscode",
"Prisma.prisma",
"streetsidesoftware.code-spell-checker",
"svelte.svelte-vscode",
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/init-firewall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ vscode_extension_publishers=(
christian-kohler
csstools
dbaeumer
esbenp
formulahendry
ms-playwright
openai
oxc
prisma
streetsidesoftware
svelte
Expand Down
34 changes: 34 additions & 0 deletions .oxfmtrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"useTabs": false,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all",
"printWidth": 100,
"sortPackageJson": false,
"svelte": {},
"associations": [
{
"files": ["*.svelte"],
"language": "svelte"
}
],
"ignorePatterns": [
".DS_Store",
"node_modules",
"/build",
"/.svelte-kit",
"/package",
".env",
".env.*",
"!.env.example",
"/.pnpm-store",
"pnpm-lock.yaml",
"package-lock.json",
"yarn.lock",
"vite.config.js.timestamp-*",
"vite.config.ts.timestamp-*",
"prisma/ERD.md",
"prisma/migrations/migration_lock.toml"
]
}
18 changes: 0 additions & 18 deletions .prettierignore

This file was deleted.

9 changes: 0 additions & 9 deletions .prettierrc

This file was deleted.

6 changes: 4 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Before adding a function, search `src/lib/utils/`, `src/lib/services/`, `src/fea

## Architecture

SvelteKit 3 + Svelte 5 Runes + TypeScript | PostgreSQL + Prisma | Flowbite Svelte + Tailwind 4 | Vitest + Playwright | oxlint + ESLint
SvelteKit 3 + Svelte 5 Runes + TypeScript | PostgreSQL + Prisma | Flowbite Svelte + Tailwind 4 | Vitest + Playwright | oxfmt + oxlint + ESLint

Layers: `prisma/` | `src/**/server/` | `src/**/zod/` | `src/**/types/`, `src/**/fixtures/` | `src/**/services/` | `src/**/utils/` | `src/**/stores/` | `src/routes/` | `src/**/*.svelte`. Each layer's constraints are in the layer table of `coding-style.md`; read it before writing logic.

Expand Down Expand Up @@ -80,7 +80,9 @@ pnpm exec prisma migrate dev --name <description>

Run project tools with `pnpm exec`, never `pnpm dlx`: `dlx` downloads the latest release and ignores the pinned version (CI once ran Prisma v7 against the v5 schema).

Lefthook runs Prettier, oxlint for JS/TS, and ESLint for Svelte before commit.
Lefthook runs oxfmt, oxlint for JS/TS, and ESLint for Svelte before commit.

Formatting belongs to oxfmt alone. Do not add ESLint or oxlint rules whose `meta.type` is `layout` (e.g. `svelte/indent`), because they would conflict with the formatter.

## Verification and Cross-review Before a PR

Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
- 文法およびフォーマットチェッカー
- [oxlint](https://oxc.rs/docs/guide/usage/linter.html): JS/TS ファイルの高速リンター(50–100x 高速)
- [ESLint](https://eslint.org/): Svelte ファイル専用リンター(eslint-plugin-svelte)のみ使用
- [Prettier](https://prettier.io/)
- [oxfmt](https://oxc.rs/docs/guide/usage/formatter.html): Prettier 互換のフォーマッター。整形は oxfmt だけが担当し、ESLint・oxlint には整形のルール(`meta.type` が `layout`)を入れない
- [lefthook](https://github.com/evilmartians/lefthook): Git hooks 管理ツール(コミット前の自動フォーマット・リント)
- Search Engine Optimization (SEO) 対策
- [Svelte Meta Tags](https://github.com/oekazuma/svelte-meta-tags): メタタグ、Open Graph などの設定
Expand Down Expand Up @@ -164,7 +164,7 @@ Claude Code と Codex は用途や利用可能な契約に応じて選択でき
- ホストの VS Code のユーザー設定に `"dev.containers.gitCredentialHelperConfigLocation": "none"` を追加し、GitHub のトークンをコンテナに共有しないようにします。
- コンテナ内の `sudo` はファイアウォール専用です。apt のパッケージや Playwright のブラウザは `Dockerfile` を変更して Rebuild します。
- インターネット向けの通信は [init-firewall.sh](.devcontainer/init-firewall.sh) の許可リストに限られ、Docker ネットワーク内では `web` から `db:5432` への通信を許可します。許可リストの宛先が突然つながらないときは CDN の IP が変わった可能性があるので、コンテナを Rebuild します。スクリプトを変更した場合も Rebuild が必要です。宛先の追加は、持ち出し経路が増えるため必要なものだけにします。
- `devcontainer.json` に VS Code の拡張機能を追加したときは、`init-firewall.sh` の `vscode_extension_publishers` にも発行者 ID(`esbenp.prettier-vscode` なら `esbenp`)を追加します。
- `devcontainer.json` に VS Code の拡張機能を追加したときは、`init-firewall.sh` の `vscode_extension_publishers` にも発行者 ID(`oxc.oxc-vscode` なら `oxc`)を追加します。拡張機能を外したときは、その発行者の拡張機能がほかに無ければ発行者 ID も消します。

#### ホスト側で SSH の鍵を ssh-agent へ登録

Expand Down Expand Up @@ -315,7 +315,7 @@ Set-Service ssh-agent -StartupType Automatic; Start-Service ssh-agent
本プロジェクトでは、[lefthook](https://github.com/evilmartians/lefthook)を使用して、コミット前に自動的にコードの書式チェック・フォーマットを行います。

- **Pre-commit Hook**: ステージ済みファイルのみに対して以下を実行
- `prettier --write`: コード書式の自動修正(JavaScript、TypeScript、Markdown、Svelte)
- `oxfmt`: コード書式の自動修正(JavaScript、TypeScript、Markdown、Svelte)
- `oxlint`: JS/TS ファイルのリント(JavaScript、TypeScript)
- `eslint`: Svelte ファイルのリント(.svelte のみ)

Expand Down
6 changes: 3 additions & 3 deletions docs/dev-notes/2026-03-27/atcoder-verified-voting/plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -509,9 +509,9 @@ return {
`EDIT_PROFILE_PAGE` は `$lib/constants/navbar-links` からインポートし、`<script>` 内で `editProfileHref` として事前計算する(`svelte/no-navigation-without-resolve` ルール対応):

```svelte
import {EDIT_PROFILE_PAGE} from '$lib/constants/navbar-links'; // ... // @ts-expect-error svelte-check
TS2554: AppTypes declaration merging causes RouteId to resolve as string, requiring params. Runtime behavior
is correct. const editProfileHref = resolve(EDIT_PROFILE_PAGE);
import {EDIT_PROFILE_PAGE} from '$lib/constants/navbar-links'; // ... // @ts-expect-error
svelte-check TS2554: AppTypes declaration merging causes RouteId to resolve as string, requiring
params. Runtime behavior is correct. const editProfileHref = resolve(EDIT_PROFILE_PAGE);
```

```svelte
Expand Down
3 changes: 2 additions & 1 deletion lefthook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ pre-commit:
parallel: true
jobs:
- name: format
run: pnpm exec prettier --write {staged_files}
# Without the flag, oxfmt exits 2 when every staged file is ignored (e.g. prisma/ERD.md)
run: pnpm exec oxfmt --no-error-on-unmatched-pattern {staged_files}
glob: '**/*.{js,jsx,ts,tsx,md,svelte}'

- name: oxlint
Expand Down
9 changes: 3 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"test": "npm run test:e2e && npm run test:unit",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --check . --cache && oxlint . && eslint .",
"format": "prettier --write .",
"lint": "oxfmt --check && oxlint . && eslint .",
"format": "oxfmt",
"test:e2e": "playwright test",
"test:unit": "vitest",
"postinstall": "prisma generate",
Expand All @@ -41,19 +41,16 @@
"@vitest/coverage-v8": "5.0.5",
"@vitest/ui": "5.0.5",
"eslint": "10.14.0",
"eslint-config-prettier": "10.1.8",
"eslint-plugin-svelte": "3.23.1",
"flowbite": "3.1.2",
"flowbite-svelte": "1.33.1",
"globals": "17.13.0",
"jsdom": "30.1.3",
"lefthook": "2.2.2",
"nock": "15.0.5",
"oxfmt": "0.75.0",
"oxlint": "1.90.0",
"pnpm": "12.16.1",
"prettier": "3.9.10",
"prettier-plugin-svelte": "4.1.1",
"prettier-plugin-tailwindcss": "0.8.1",
"prisma": "5.22.0",
"prisma-markdown": "1.0.9",
"super-sitemap": "1.0.12",
Expand Down
Loading
Loading