From 43163137018b33d6e113b3bcf6ba3f63a20d8a9b Mon Sep 17 00:00:00 2001 From: 273* Date: Thu, 21 May 2026 22:59:45 +0900 Subject: [PATCH 1/2] =?UTF-8?q?chore:=20coderabbit=E3=81=AE=E8=A8=AD?= =?UTF-8?q?=E5=AE=9A=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .coderabbit.yaml | 53 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .coderabbit.yaml diff --git a/.coderabbit.yaml b/.coderabbit.yaml new file mode 100644 index 0000000..c931b2c --- /dev/null +++ b/.coderabbit.yaml @@ -0,0 +1,53 @@ +language: "ja" + +reviews: + profile: "chill" + request_changes_workflow: false + high_level_summary: true + poem: false + review_status: true + collapse_walkthrough: false + auto_review: + enabled: true + drafts: false + + path_instructions: + - path: "**/*.ts,**/*.tsx" + instructions: | + # コーディング規約 + - 型定義は `interface` ではなく `type` を使う + - Reactコンポーネントは `function` 宣言、それ以外は `const` で定義する + - import順: 外部パッケージ → `@/` → 相対パス の順で、グループ間は空行で区切る + - Props の各プロパティとエクスポートされる関数・コンポーネントには JSDoc(`/** ... */`)を記載する + + # React / Hooks + - `useMemo` / `useCallback` を不必要に追加しない(React Compiler が有効なため) + - `useRef` + `initialized` フラグで初期化するフックを使うフォームは、再マウントが必要な場面(編集モード切替など)で別コンポーネントとして定義する + - `useLiveQuery` で `with:` を含むクエリは、ルートテーブル以外の変更を自動検知しない。関連テーブルの更新後はルートテーブルを touch する + - `useLiveQuery` に動的な引数を渡す場合は第2引数に依存配列を渡す + + # TypeScript + - `any` を使わず、適切な型を定義する + - 型アサーション(`as`)は最小限にとどめ、型ガードで代替できる場合はそちらを使う + - 関数の戻り値型は推論可能な場合でも、公開APIには明示することを推奨する + + # SwiftUI / UI + - アダプティブカラーは `PlatformColor` を使い、ハードコードした色値を直接指定しない + - タップ処理は `onPress` ではなく `onTapGesture` モディファイアを使う + - `Keyboard.dismiss()` はナビゲーションを伴う非同期処理の前に同期的に呼び出す + - `List` の中に `ScrollView` をネストしない + - ネイティブヘッダーのボタンは `unstable_headerRightItems` で定義する(`headerRight` + RN `Pressable` は使わない) + + - path: "src/db/schemas/**" + instructions: | + - カラム名は camelCase で定義する(例: `sortOrder`, `createdAt`) + - スキーマファイルから React Native ランタイムパッケージを `import type` 以外でインポートしない + - IDの生成は `$defaultFn` ではなくアプリ層(`Crypto.randomUUID()`)で行う + + - path: "src/db/queries/**" + instructions: | + - トランザクションで関連テーブルを更新する場合、`useLiveQuery` が検知できるようルートテーブルの `updatedAt` を touch する + + - path: "drizzle/**" + instructions: | + - 自動生成ファイルのため手動編集しない。変更は `pnpm drizzle-kit generate` で生成する From 65b775800ae4dd9500307113f261ad1fac717f20 Mon Sep 17 00:00:00 2001 From: 273* Date: Thu, 21 May 2026 23:11:22 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20path=E3=82=92=E9=81=A9=E5=88=87?= =?UTF-8?q?=E3=81=AA=E3=82=82=E3=81=AE=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .coderabbit.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.coderabbit.yaml b/.coderabbit.yaml index c931b2c..1d2a49e 100644 --- a/.coderabbit.yaml +++ b/.coderabbit.yaml @@ -12,7 +12,7 @@ reviews: drafts: false path_instructions: - - path: "**/*.ts,**/*.tsx" + - path: "**/*.{ts,tsx}" instructions: | # コーディング規約 - 型定義は `interface` ではなく `type` を使う