feat: プロジェクトの品質管理設定を追加 - #70
Conversation
- ESLint設定ファイル(TypeScript対応)を追加 - Prettier設定ファイルを追加 - package.jsonに基本的なnpmスクリプト(lint、format等)を追加 - Huskyによるpre-commitとcommit-msgフックを設定 - GitHub ActionsのCIワークフローを追加 - VSCode用の推奨設定とextensionsを追加 - .gitignoreを推奨パターンに更新 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. WalkthroughThis update introduces and configures development tooling and documentation improvements. It adds ESLint and Prettier configurations, Husky Git hooks, and a GitHub Actions CI workflow. The Changes
Sequence Diagram(s)sequenceDiagram
participant Developer
participant Git
participant Husky
participant ESLint
participant Prettier
participant GitHub Actions
Developer->>Git: git commit
Git->>Husky: Trigger pre-commit hook
Husky->>ESLint: Run lint
ESLint-->>Husky: Lint results
Husky->>Git: Continue commit if lint passes
Note over Developer,GitHub Actions: On PR or push to main/master
GitHub Actions->>GitHub Actions: Checkout code
GitHub Actions->>Node.js: Setup Node.js
GitHub Actions->>NPM: Install dependencies
GitHub Actions->>ESLint: Run lint
GitHub Actions->>Prettier: Check formatting
GitHub Actions->>NPM: Run test (continue on error)
GitHub Actions->>NPM: Run build (continue on error)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~15 minutes Possibly related PRs
Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (34)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (5)
.claude/commands/init-project.md (1)
29-31: Format the URL as a proper markdown link.The bare URL should be formatted as a proper markdown link to address the markdownlint warning.
-https://containers.dev/features - -上記で存在の確認をしてから導入するようにしてください。 +[containers.dev/features](https://containers.dev/features)で存在の確認をしてから導入するようにしてください。.vscode/extensions.json (1)
1-7: Add a trailing newline to satisfy Prettier / CI warningsCI reports a Prettier formatting warning; the only visible issue is the missing newline at EOF.
Adding it avoids needless noise in every run.- ] -} + ] +} +.prettierrc (1)
1-11: Self-apply the very rules you declareCI flags this file for formatting – ironic for a Prettier config.
Runningprettier --write .prettierrcwill (again) just append a final newline.
Commit the reformatted file so the pipeline turns green..eslintrc.js (1)
1-34: Minor hardening of the ESLint config
- Declare the config as project-root so ESLint doesn’t crawl parent dirs.
- Leverage Prettier’s recommended plugin to auto-raise format issues as ESLint errors.
module.exports = { + root: true, extends: [ 'eslint:recommended', 'plugin:@typescript-eslint/recommended', - 'prettier' + 'plugin:prettier/recommended' ],This keeps the toolchain single-sourced and prevents config bleed.
package.json (1)
14-17: Consider narrowing the ESLint / Prettier glob to avoid unnecessary work
eslint .andprettier --write .traverse every file under the repo, including large directories such as.husky/,.github/, generated assets, etc.A leaner default improves speed and avoids unexpected formatting of non-source files:
- "lint": "eslint . --ext .js,.jsx,.ts,.tsx", - "format": "prettier --write .", + "lint": "eslint \"src/**/*.{js,jsx,ts,tsx}\"", + "format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,json,md}\"",Adjust the glob to match your project layout.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
package-lock.jsonis excluded by!**/package-lock.jsonsupabase/.temp/cli-latestis excluded by!**/.temp/**
📒 Files selected for processing (11)
.claude/commands/init-project.md(2 hunks).claude/settings.local.json(1 hunks).eslintrc.js(1 hunks).github/workflows/ci.yml(1 hunks).gitignore(1 hunks).husky/commit-msg(1 hunks).husky/pre-commit(1 hunks).prettierrc(1 hunks).vscode/extensions.json(1 hunks).vscode/settings.json(1 hunks)package.json(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: the body of the commit message should be wrapped at 72 characters and should prioritize describing w...
Learnt from: CR
PR: keito4/config#0
File: .cursor/rules/commit.cursorrules:0-0
Timestamp: 2025-06-25T06:37:26.200Z
Learning: The body of the commit message should be wrapped at 72 characters and should prioritize describing what was done over why it was done.
Applied to files:
.husky/commit-msg
🪛 GitHub Actions: CI
.claude/settings.local.json
[warning] 1-1: Prettier formatting warning. Code style issues found. Run 'prettier --write' to fix.
.vscode/extensions.json
[warning] 1-1: Prettier formatting warning. Code style issues found. Run 'prettier --write' to fix.
.vscode/settings.json
[warning] 1-1: Prettier formatting warning. Code style issues found. Run 'prettier --write' to fix.
.claude/commands/init-project.md
[warning] 1-1: Prettier formatting warning. Code style issues found. Run 'prettier --write' to fix.
.eslintrc.js
[warning] 1-1: Prettier formatting warning. Code style issues found. Run 'prettier --write' to fix.
.github/workflows/ci.yml
[warning] 1-1: Prettier formatting warning. Code style issues found. Run 'prettier --write' to fix.
.prettierrc
[warning] 1-1: Prettier formatting warning. Code style issues found. Run 'prettier --write' to fix.
🪛 markdownlint-cli2 (0.17.2)
.claude/commands/init-project.md
29-29: Bare URL used
(MD034, no-bare-urls)
🪛 YAMLlint (1.37.1)
.github/workflows/ci.yml
[error] 13-13: trailing spaces
(trailing-spaces)
[error] 18-18: trailing spaces
(trailing-spaces)
[error] 21-21: trailing spaces
(trailing-spaces)
[error] 24-24: trailing spaces
(trailing-spaces)
[error] 27-27: trailing spaces
(trailing-spaces)
[error] 31-31: trailing spaces
(trailing-spaces)
[error] 34-34: no new line character at the end of file
(new-line-at-end-of-file)
🔇 Additional comments (9)
.claude/commands/init-project.md (2)
16-17: LGTM: Clear feature documentation improvements.The separation of Node.js and pnpm features with explicit container image references improves clarity and makes the setup more reproducible.
26-26: LGTM: Explicit container image reference.Adding the explicit container image reference for jq-likes feature improves reproducibility and follows best practices.
.gitignore (3)
5-8: LGTM: Improved dependency handling.The renaming from "Node modules and logs" to "Dependencies" and addition of
.pnpfiles provides better coverage for modern package management tools.
30-32: Excellent .vscode directory handling.This approach properly ignores the .vscode directory while preserving the workspace configuration files (extensions.json and settings.json) that should be shared across the team.
37-38: Good addition for TypeScript projects.The
*.tsbuildinfoignore pattern is essential for TypeScript projects to avoid committing build cache files..husky/pre-commit (1)
1-1: LGTM: Proper pre-commit linting setup.This hook correctly integrates with the npm lint script to enforce code quality before commits. The simple implementation follows Husky best practices.
.claude/settings.local.json (1)
29-30: LGTM: Necessary Husky permissions.These permission additions are required for the Husky Git hooks setup to function properly. The scope is appropriately limited to specific Husky commands.
.husky/commit-msg (1)
1-1: LGTM: Simplified and correct commit message hook.The simplification to use
$1instead of${1}and removal of the--no --flags makes this hook cleaner while maintaining the same functionality for commit message linting..vscode/settings.json (1)
1-23: Ensure the"source.fixAll.eslint"value is supported by your VS Code versionThe string value
"explicit"is only respected in relatively recent VS Code builds (≥ 1.83).
On older versions the setting is ignored and auto-fix on save never triggers.
If your team is on mixed IDE versions, consider falling back to the boolean form:"editor.codeActionsOnSave": { "source.fixAll.eslint": true }
| - name: Run tests | ||
| run: npm run test | ||
| continue-on-error: true # テストが未設定のため一時的にエラーを無視 | ||
|
|
||
| - name: Build | ||
| run: npm run build | ||
| continue-on-error: true # ビルドプロセスが未設定のため一時的にエラーを無視 No newline at end of file |
There was a problem hiding this comment.
🛠️ Refactor suggestion
continue-on-error hides real failures
Using continue-on-error: true for tests and build means CI turns green even if
those steps explode. Once tests/build exist you may forget to remove the flag,
defeating the pipeline’s purpose.
Consider gating merges on the real outcome and using
if: always() && failure() + needs: fan-out patterns when you genuinely need
soft-fail behaviour.
🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 31-31: trailing spaces
(trailing-spaces)
[error] 34-34: no new line character at the end of file
(new-line-at-end-of-file)
🤖 Prompt for AI Agents
In .github/workflows/ci.yml around lines 28 to 34, the use of continue-on-error:
true for the test and build steps hides real failures, causing the CI to pass
even if these steps fail. Remove continue-on-error: true from these steps to
ensure the pipeline fails on errors. If soft-fail behavior is needed, implement
conditional steps using if: always() && failure() and coordinate with needs:
dependencies to properly handle failure reporting without masking errors.
| "format": "prettier --write .", | ||
| "format:check": "prettier --check .", | ||
| "type-check": "echo 'No TypeScript configured'", | ||
| "prepare": "husky" |
There was a problem hiding this comment.
Use husky install in prepare to actually enable the Git hooks
Running plain husky only prints CLI help; it does not install the hook runner into .git/hooks.
Without that step, neither the pre-commit nor commit-msg hooks added in this PR will fire.
- "prepare": "husky"
+ "prepare": "husky install"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "prepare": "husky" | |
| "prepare": "husky install" |
🤖 Prompt for AI Agents
In package.json at line 19, the "prepare" script currently runs "husky" which
only shows CLI help and does not install Git hooks. Change the script to "husky
install" to properly install the Husky Git hooks into the .git/hooks directory,
ensuring that pre-commit and commit-msg hooks will be triggered as intended.
| "@typescript-eslint/eslint-plugin": "^8.19.0", | ||
| "@typescript-eslint/parser": "^8.19.0", |
There was a problem hiding this comment.
Add typescript – it’s a required peer-dependency for @typescript-eslint/*
@typescript-eslint/parser dynamically loads the TypeScript compiler.
With no typescript package in devDependencies, npm run lint will crash with
Error: Cannot find module 'typescript'.
Minimal fix:
"@typescript-eslint/eslint-plugin": "^8.19.0",
"@typescript-eslint/parser": "^8.19.0",
+ "typescript": "^5.4.2",(Optional) replace the placeholder at Line 18 with a real type-check command once TypeScript is present:
- "type-check": "echo 'No TypeScript configured'",
+ "type-check": "tsc --noEmit",Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In package.json around lines 28 to 29, the devDependencies include
@typescript-eslint packages but are missing the required peer dependency
"typescript". Add "typescript" with an appropriate version to the
devDependencies section to prevent runtime errors when running lint commands.
Optionally, update the placeholder lint script at line 18 to a real type-check
command now that TypeScript is included.
- DevContainer用のmounts設定の推奨例を追加 - .cursor、.gitconfig、.config/ghのマウント設定を記載 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- ~/.claude/.credentials.jsonのマウント設定を推奨に追加 - Claude CLIの認証情報をコンテナ内で利用可能にするため 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- 全ファイルにPrettierフォーマットを適用 - CIのformat:checkエラーを修正 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (3)
.claude/commands/init-project.md (3)
16-17: Unify container-image notation for feature bullets
Node.jsomits the container image whilepnpmincludes it in quotes. This breaks consistency with the laterjq-likesentry (Line 26). Either list all features without images or attach images to each bullet in the same style.- - **Node.js**: フロントエンド開発 - - **pnpm**: パッケージ管理("ghcr.io/devcontainers-extra/features/pnpm:2") + - **Node.js**: フロントエンド開発 ("ghcr.io/devcontainers/features/node:20") + - **pnpm**: パッケージ管理 ("ghcr.io/devcontainers-extra/features/pnpm:2")
26-26: Remove superfluous quotes around image referenceSurrounding the image string with quotes is unnecessary and inconsistent with other documentation. Drop them for uniformity.
- - **jq-likes**: JSON/YAML処理ツール("ghcr.io/eitsupi/devcontainer-features/jq-likes:2") + - **jq-likes**: JSON/YAML処理ツール (ghcr.io/eitsupi/devcontainer-features/jq-likes:2)
29-31: Fix markdown-lint “bare URL” and sentence flowWrap the URL in angle brackets and merge the advisory note into a single sentence so the period is placed after the URL.
-https://containers.dev/features - -上記で存在の確認をしてから導入するようにしてください。 +<https://containers.dev/features> で feature が存在するか確認してから導入してください。This will silence MD034 and improve readability.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.claude/commands/init-project.md(3 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
.claude/commands/init-project.md
29-29: Bare URL used
(MD034, no-bare-urls)
🪛 GitHub Actions: CI
.claude/commands/init-project.md
[warning] 1-1: Prettier formatting warning. Run 'prettier --write' to fix code style issues in this file.
|
|
||
| ### mounts推奨設定 | ||
|
|
||
| ```json | ||
| { | ||
| "mounts": [ | ||
| "source=${localEnv:HOME}/.cursor,target=/home/vscode/.cursor,type=bind,consistency=cached", | ||
| "source=${localEnv:HOME}/.gitconfig,target=/home/vscode/.gitconfig,type=bind,consistency=cached", | ||
| "source=${localEnv:HOME}/.config/gh,target=/home/vscode/.config/gh,type=bind,consistency=cached", | ||
| "source=${localEnv:HOME}/.claude/.credentials.json,target=/home/vscode/.claude/.credentials.json,type=bind,consistency=cached" | ||
| ] | ||
| } |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Mount list contradicts earlier description
Earlier in the doc (Lines 61-66) you state that only .gitconfig, .gitignore, and ~/.config/gh/hosts.yml are mounted.
The JSON snippet here re-adds .cursor and .claude/.credentials.json while omitting .gitignore.
Please reconcile these two sections so that:
- The same set of mounts is documented only once.
- Security-sensitive mounts (e.g. credentials) are justified or removed.
🏁 Script executed:
#!/bin/bash
# Print lines 61-66 from the init-project.md to verify the earlier mounts description
sed -n '61,66p' .claude/commands/init-project.mdLength of output: 179
🏁 Script executed:
#!/bin/bash
# Verify the JSON snippet at lines 257-268 in init-project.md
sed -n '250,270p' .claude/commands/init-project.mdLength of output: 664
Inconsistent mount configuration — please reconcile
The mounts listed at the top of this document (Lines 61–66) differ from the JSON snippet in the “mounts推奨設定” section (Lines 257–268). Specifically:
-
Top section mounts:
•~/.gitconfig
•~/.gitignore
•~/.config/gh/hosts.yml -
JSON snippet mounts:
•${HOME}/.cursor
•${HOME}/.gitconfig
•${HOME}/.config/gh
•${HOME}/.claude/.credentials.json
Actions needed:
- Choose a single, authoritative list of mounts and remove duplication.
- Ensure
.gitignoreappears in the final configuration (or explain why it’s omitted). - Evaluate whether binding sensitive files like
~/.claude/.credentials.jsonis necessary; document any security considerations or remove it entirely. - If you really need to bind the entire
~/.config/ghdirectory, clarify why you’re no longer targeting onlyhosts.yml.
Bullet-point the final mounts list in one place, update both the prose (Lines 61–66) and the JSON snippet (Lines 257–268) to match, and justify any security-sensitive mounts.
🤖 Prompt for AI Agents
In .claude/commands/init-project.md around lines 61-66 and 257-268, the mount
configurations are inconsistent between the top section and the JSON snippet. To
fix this, consolidate the mounts into a single authoritative list that includes
all necessary files such as .gitignore, and update both sections to match
exactly. Review the inclusion of sensitive files like
~/.claude/.credentials.json, either remove it or add a clear security
justification. Also clarify if binding the entire ~/.config/gh directory is
needed instead of just hosts.yml, and document the reason. Finally, bullet-point
the final mounts list in one place and ensure both the prose and JSON snippet
reflect this unified configuration.
Summary
Changes
✅ ESLint設定 (
.eslintrc.js)✅ Prettier設定 (
.prettierrc)✅ npm scripts (
package.json)✅ Git hooks (
.husky/)✅ CI/CD (
.github/workflows/ci.yml)✅ VSCode設定 (
.vscode/)✅ gitignore更新
Test plan
npm installで依存関係のインストールが成功することnpm run lintでリントチェックが実行されることnpm run formatでコードフォーマットが実行されること🤖 Generated with Claude Code
Summary by CodeRabbit