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.
@@ -1,62 +1,42 @@
1
- # vitest — Vitest test-file rules
1
+ # vitest — Vitest test files (official @vitest/eslint-plugin setup)
2
2
 
3
- For apps that test with Vitest (CBP web + CLI + most repos). Layers a **test-scoped** override
4
- on top of [base](base.md). Maps to the CBP **`testing`** DB preset
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
- > **Verified 2026-05-31.** The package was **renamed** to the scoped
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
- ## Packages
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
- pnpm add -D @vitest/eslint-plugin
11
+ npm install @vitest/eslint-plugin --save-dev
19
12
  ```
20
13
 
21
- ## Flat config
14
+ ## eslint.config.mjs (official example)
22
15
 
23
16
  ```js
24
- // eslint.config.mjs
17
+ import { defineConfig } from "eslint/config";
25
18
  import vitest from "@vitest/eslint-plugin";
26
19
 
27
- export default [
28
- {
29
- files: ["**/*.{test,spec}.{ts,tsx,js,jsx}"],
30
- plugins: { vitest },
31
- rules: {
32
- ...vitest.configs.recommended.rules,
33
- // tests are I/O-heavy + mock-heavy — relax type-safety on test files:
34
- "@typescript-eslint/no-explicit-any": "off",
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
- ## Gotchas
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 CBP `testing` preset matches this (the six `no-unsafe-*`/`no-explicit-any` opt-outs,
58
- `@vitest/eslint-plugin: ^1.0.0`). No divergence.
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
- ## Official docs
40
+ ## Source
61
41
 
62
- - @vitest/eslint-plugin: https://github.com/vitest-dev/eslint-plugin-vitest
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