add claude specific configuration and instruction
This commit is contained in:
12
.claude/rules/testing.md
Normal file
12
.claude/rules/testing.md
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
paths: ["**/*.spec.ts", "**/*.type-spec.ts"]
|
||||
---
|
||||
|
||||
# Test Conventions
|
||||
|
||||
- **`*.spec.ts`** — runtime tests. Use Arrange/Act/Assert with `describe`/`it` blocks.
|
||||
- **`*.type-spec.ts`** — compile-time type tests. Use `expectTypeOf(x).toEqualTypeOf<T>()` from expect-type.
|
||||
- Tests live in `spec/` directories next to the module, one file per operation (e.g., `map.spec.ts`).
|
||||
- When adding a new method, create both a `*.spec.ts` and `*.type-spec.ts` for it.
|
||||
- Run runtime tests: `pnpm test -- src/{module}/spec/{file}.spec.ts`
|
||||
- Run type tests: `pnpm test:types`
|
||||
23
.claude/settings.json
Normal file
23
.claude/settings.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"permissions": {
|
||||
"deny": [
|
||||
"Read(.env*)",
|
||||
"Read(**/*.pem)",
|
||||
"Read(**/*.key)"
|
||||
]
|
||||
},
|
||||
"hooks": {
|
||||
"PostToolUse": [
|
||||
{
|
||||
"matcher": "Write|Edit|MultiEdit",
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "filepath=$(jq -r '.tool_input.file_path // .tool_input.path // empty' /dev/stdin) && [ -n \"$filepath\" ] && pnpm exec prettier --write \"$filepath\" 2>/dev/null && [[ \"$filepath\" =~ \\.(ts|tsx|js|jsx)$ ]] && pnpm exec eslint --fix \"$filepath\" 2>/dev/null || true",
|
||||
"timeout": 25
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user