codebyplan 1.13.3 → 1.13.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -0
- package/dist/cli.js +96 -18
- package/package.json +1 -1
- package/templates/hooks/README.md +31 -19
- package/templates/hooks/cbp-cmux-branch-watch.sh +39 -0
- package/templates/hooks/cbp-cmux-workspace-sync.sh +19 -0
- package/templates/hooks/cbp-test-hooks.sh +74 -11
- package/templates/hooks/hooks.json +14 -5
- package/templates/settings.project.base.json +2 -0
- package/templates/skills/cbp-setup-eslint/SKILL.md +4 -3
- package/templates/skills/cbp-setup-eslint/reference/base.md +44 -55
- package/templates/skills/cbp-setup-eslint/reference/cli.md +43 -36
- package/templates/skills/cbp-setup-eslint/reference/e2e.md +57 -47
- package/templates/skills/cbp-setup-eslint/reference/jest.md +22 -38
- package/templates/skills/cbp-setup-eslint/reference/nestjs.md +39 -40
- package/templates/skills/cbp-setup-eslint/reference/nextjs.md +39 -40
- package/templates/skills/cbp-setup-eslint/reference/node.md +25 -54
- package/templates/skills/cbp-setup-eslint/reference/react-native.md +33 -37
- package/templates/skills/cbp-setup-eslint/reference/react.md +33 -58
- package/templates/skills/cbp-setup-eslint/reference/tailwind.md +45 -49
- package/templates/skills/cbp-setup-eslint/reference/testing-react.md +28 -37
- package/templates/skills/cbp-setup-eslint/reference/vitest.md +25 -45
- package/templates/hooks/cbp-notify.sh +0 -68
|
@@ -1,62 +1,42 @@
|
|
|
1
|
-
# vitest — Vitest test-
|
|
1
|
+
# vitest — Vitest test files (official @vitest/eslint-plugin setup)
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
(`tech_match.requires: ["Vitest"]`).
|
|
3
|
+
> **Official source**: https://github.com/vitest-dev/eslint-plugin-vitest (verified 2026-05-31). This
|
|
4
|
+
> is the plugin's official flat-config example verbatim.
|
|
6
5
|
|
|
7
|
-
>
|
|
8
|
-
> **`@vitest/eslint-plugin`** (the old `eslint-plugin-vitest` is the deprecated name). Its
|
|
9
|
-
> flat-config key is plain **`configs.recommended`** — there is **no `flat/` prefix**.
|
|
6
|
+
> The package was renamed from `eslint-plugin-vitest` to the scoped **`@vitest/eslint-plugin`**.
|
|
10
7
|
|
|
11
|
-
##
|
|
12
|
-
|
|
13
|
-
| Package | Latest | Purpose |
|
|
14
|
-
| ------- | ------ | ------- |
|
|
15
|
-
| `@vitest/eslint-plugin` | `1.6.18` | Vitest rules (scoped pkg) |
|
|
8
|
+
## Install
|
|
16
9
|
|
|
17
10
|
```bash
|
|
18
|
-
|
|
11
|
+
npm install @vitest/eslint-plugin --save-dev
|
|
19
12
|
```
|
|
20
13
|
|
|
21
|
-
##
|
|
14
|
+
## eslint.config.mjs (official example)
|
|
22
15
|
|
|
23
16
|
```js
|
|
24
|
-
|
|
17
|
+
import { defineConfig } from "eslint/config";
|
|
25
18
|
import vitest from "@vitest/eslint-plugin";
|
|
26
19
|
|
|
27
|
-
export default
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"@typescript-eslint/no-unsafe-assignment": "off",
|
|
36
|
-
"@typescript-eslint/no-unsafe-member-access": "off",
|
|
37
|
-
"@typescript-eslint/no-unsafe-call": "off",
|
|
38
|
-
"@typescript-eslint/no-unsafe-argument": "off",
|
|
39
|
-
"@typescript-eslint/no-unsafe-return": "off",
|
|
40
|
-
},
|
|
41
|
-
settings: { vitest: { typecheck: true } }, // only if using Vitest type-testing
|
|
20
|
+
export default defineConfig({
|
|
21
|
+
files: ["tests/**"], // or any other pattern
|
|
22
|
+
plugins: {
|
|
23
|
+
vitest,
|
|
24
|
+
},
|
|
25
|
+
rules: {
|
|
26
|
+
...vitest.configs.recommended.rules,
|
|
27
|
+
"vitest/max-nested-describe": ["error", { max: 3 }],
|
|
42
28
|
},
|
|
43
|
-
|
|
29
|
+
});
|
|
44
30
|
```
|
|
45
31
|
|
|
46
|
-
##
|
|
47
|
-
|
|
48
|
-
- The key is **`vitest.configs.recommended`** (plain) — NOT `configs['flat/recommended']`.
|
|
49
|
-
Other plugins use the bracketed `flat/` form; Vitest does not.
|
|
50
|
-
- When you spread only `.rules`, register `plugins: { vitest }` yourself. Alternatively spread
|
|
51
|
-
the whole `...vitest.configs.recommended` (carries the plugin registration).
|
|
52
|
-
- The `no-unsafe-*` / `no-explicit-any` opt-outs are CBP convention — production code keeps
|
|
53
|
-
them at `error`; test surfaces relax them because mocks produce `any`-typed values.
|
|
54
|
-
|
|
55
|
-
## CBP preset divergence
|
|
32
|
+
## Notes (from the official docs)
|
|
56
33
|
|
|
57
|
-
The
|
|
58
|
-
|
|
34
|
+
- The config key is **`vitest.configs.recommended`** — there is **no `flat/` prefix** (unlike most
|
|
35
|
+
other test plugins). Variants: `configs.recommended` and `configs.all`.
|
|
36
|
+
- Register `plugins: { vitest }` yourself when spreading only `.rules`.
|
|
37
|
+
- Scope to your test files via `files`. Vitest type-testing uses a separate `typecheck: true` setting.
|
|
38
|
+
- The README still shows legacy `.eslintrc` JSON for ESLint ≤ v8.57.0 alongside flat config.
|
|
59
39
|
|
|
60
|
-
##
|
|
40
|
+
## Source
|
|
61
41
|
|
|
62
|
-
-
|
|
42
|
+
- https://github.com/vitest-dev/eslint-plugin-vitest
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
# @hook: Notification
|
|
3
|
-
# Hook: Notification for all matchers
|
|
4
|
-
# Purpose: Send desktop notifications with project context. Cross-platform graceful-degrade —
|
|
5
|
-
# silent no-op when terminal-notifier is missing (Linux/Windows/macOS without Homebrew);
|
|
6
|
-
# VS Code click-to-focus action only on macOS hosts with `code` on PATH.
|
|
7
|
-
# Exit 0 = always (notification hooks must never block Claude)
|
|
8
|
-
#
|
|
9
|
-
# Known: notification_type is not sent in JSON input (anthropics/claude-code#11964)
|
|
10
|
-
# Input fields: session_id, cwd, hook_event_name, message
|
|
11
|
-
|
|
12
|
-
set +e
|
|
13
|
-
|
|
14
|
-
# Graceful skip on hosts without terminal-notifier (Linux, Windows, macOS w/o Homebrew)
|
|
15
|
-
command -v terminal-notifier >/dev/null 2>&1 || exit 0
|
|
16
|
-
|
|
17
|
-
# Read JSON input from stdin
|
|
18
|
-
INPUT=$(cat)
|
|
19
|
-
|
|
20
|
-
# Parse notification fields
|
|
21
|
-
eval "$(echo "$INPUT" | jq -r '
|
|
22
|
-
@sh "MESSAGE=\(.message // "")",
|
|
23
|
-
@sh "CWD=\(.cwd // "")"
|
|
24
|
-
' 2>/dev/null)"
|
|
25
|
-
|
|
26
|
-
# Detect project name
|
|
27
|
-
if [ -n "$CLAUDE_PROJECT_DIR" ]; then
|
|
28
|
-
PROJECT_DIR="$CLAUDE_PROJECT_DIR"
|
|
29
|
-
elif [ -n "$CWD" ]; then
|
|
30
|
-
PROJECT_DIR="$CWD"
|
|
31
|
-
else
|
|
32
|
-
PROJECT_DIR="unknown"
|
|
33
|
-
fi
|
|
34
|
-
PROJECT_NAME=$(basename "$PROJECT_DIR")
|
|
35
|
-
|
|
36
|
-
TITLE="[$PROJECT_NAME] Claude Code"
|
|
37
|
-
BODY="${MESSAGE:-Claude Code notification}"
|
|
38
|
-
|
|
39
|
-
# VS Code focus click action — only on macOS with `code` available
|
|
40
|
-
CLICK_ACTION=""
|
|
41
|
-
if [[ "$OSTYPE" == darwin* ]] && command -v code >/dev/null 2>&1; then
|
|
42
|
-
# Quote path for re-parse by terminal-notifier -execute (POSIX sh)
|
|
43
|
-
SAFE_DIR=$(printf '%q' "$PROJECT_DIR")
|
|
44
|
-
CLICK_ACTION="code -r $SAFE_DIR && sleep 0.3 && osascript -e 'tell application \"System Events\" to keystroke \"\`\" using control down'"
|
|
45
|
-
fi
|
|
46
|
-
|
|
47
|
-
# Send notification via terminal-notifier in background (non-blocking).
|
|
48
|
-
# Omit -execute argument entirely when CLICK_ACTION is empty (avoid passing empty string).
|
|
49
|
-
if [ -n "$CLICK_ACTION" ]; then
|
|
50
|
-
terminal-notifier \
|
|
51
|
-
-title "$TITLE" \
|
|
52
|
-
-message "$BODY" \
|
|
53
|
-
-sound "Glass" \
|
|
54
|
-
-group "claude-${PROJECT_NAME}" \
|
|
55
|
-
-execute "$CLICK_ACTION" \
|
|
56
|
-
-sender "com.microsoft.VSCode" \
|
|
57
|
-
> /dev/null 2>&1 &
|
|
58
|
-
else
|
|
59
|
-
terminal-notifier \
|
|
60
|
-
-title "$TITLE" \
|
|
61
|
-
-message "$BODY" \
|
|
62
|
-
-sound "Glass" \
|
|
63
|
-
-group "claude-${PROJECT_NAME}" \
|
|
64
|
-
-sender "com.microsoft.VSCode" \
|
|
65
|
-
> /dev/null 2>&1 &
|
|
66
|
-
fi
|
|
67
|
-
|
|
68
|
-
exit 0
|