Skip to content
Merged
Changes from 1 commit
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
31 changes: 31 additions & 0 deletions .claude/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"$schema": "https://json.schemastore.org/claude-code-settings.json",
"hooks": {
"PreToolUse": [
{
"matcher": "Edit|Write",
"hooks": [
{
"type": "command",
"shell": "bash",
"statusMessage": "機微ファイルの編集を確認中…",
"command": "jq -r '.tool_input.file_path // empty' | tr -d '\\r' | { read -r f; b=$(basename \"$f\"); case \"$b\" in .env|.env.*|bun.lock) jq -nc --arg b \"$b\" '{hookSpecificOutput:{hookEventName:\"PreToolUse\",permissionDecision:\"deny\",permissionDecisionReason:($b+\" は機微ファイル/ロックファイルのため自動編集をブロックしました。手動編集が必要な場合はユーザーが直接行ってください。\")}}';; esac; }"
}
]
}
],
"PostToolUse": [
{
"matcher": "Edit|Write",
"hooks": [
{
"type": "command",
"shell": "bash",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

biome check --write は整形だけでなく safe lint auto-fix(未使用 import の除去など)も適用します。

PR 説明にある「husky の biome check と齟齬をなくす」意図には合致しており、意図的な選択だと理解しています。ただし、フォーマットのみに絞りたい場合は biome format --write が安全です(lint fix を適用しないため、予期しない変更が発生しにくい)。

また、*.json に .claude/settings.json 自体が含まれます。Claude がこのファイルを編集すると biome が再フォーマットしますが、プロジェクトの biome.json がデフォルト設定(タブインデント)のため実害は少ないはずです。

"statusMessage": "biome で整形中…",
"command": "jq -r '.tool_input.file_path // .tool_response.filePath // empty' | tr -d '\\r' | { read -r f; case \"$f\" in *.ts|*.tsx|*.js|*.jsx|*.mjs|*.cjs|*.json|*.jsonc|*.css) bunx @biomejs/biome check --write \"$f\";; esac; } 2>/dev/null || true"
}
]
}
]
}
}
Loading