codebyplan 1.13.3 → 1.13.4

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,64 +1,60 @@
1
- # tailwind — Tailwind CSS class linting
1
+ # tailwind — Tailwind CSS class linting (eslint-plugin-better-tailwindcss)
2
2
 
3
- For apps using Tailwind CSS (the CBP `tarkur` repo uses Tailwind + shadcn/ui). **Gap stack
4
- no CBP DB preset.** Adds class-sorting / validation rules on top of the app's base config.
3
+ > **Tailwind ships no first-party ESLint plugin.** Tailwind's official Editor Setup docs recommend only
4
+ > the IntelliSense extension + the official Prettier class-sorting plugin no ESLint config. The
5
+ > community-standard plugin is `eslint-plugin-better-tailwindcss` (by schoero); its official setup is
6
+ > below (verified 2026-05-31).
5
7
 
6
- > **Verified 2026-05-31.** Use **`eslint-plugin-better-tailwindcss`** — it is the only plugin
7
- > with first-class **Tailwind v4** + ESLint 9/10 flat-config support. The original
8
- > `eslint-plugin-tailwindcss` only handles v4 on an unstable alpha — **avoid it for v4.**
9
-
10
- ## Packages
11
-
12
- | Package | Latest | Tailwind v4? | Verdict |
13
- | ------- | ------ | ------------ | ------- |
14
- | `eslint-plugin-better-tailwindcss` | `4.5.0` | **yes (stable)** | **use this** |
15
- | `eslint-plugin-tailwindcss` | `3.18.3` (v4 only on `4.0.0-alpha`) | beta/as-is | avoid for v4 |
8
+ ## Install
16
9
 
17
10
  ```bash
18
- pnpm add -D eslint-plugin-better-tailwindcss
11
+ npm i -D eslint-plugin-better-tailwindcss
19
12
  ```
20
13
 
21
- Peer deps: `eslint ^7 || ^8 || ^9 || ^10`, `tailwindcss ^3.3.0 || ^4.1.17`. Node ≥ 20.19.
14
+ > Depending on your file flavor (JSX/TSX/Vue/Svelte/Astro/HTML/CSS) you may also need the matching
15
+ > parser — see the plugin's per-parser docs.
22
16
 
23
- ## Flat config
17
+ ## eslint.config.js — React/JSX (official example)
24
18
 
25
19
  ```js
26
- // eslint.config.mjs
20
+ import eslintPluginBetterTailwindcss from "eslint-plugin-better-tailwindcss";
27
21
  import { defineConfig } from "eslint/config";
28
- import betterTailwind from "eslint-plugin-better-tailwindcss";
29
22
 
30
- export default defineConfig([
31
- {
32
- extends: [betterTailwind.configs["recommended"]],
33
- settings: {
34
- "better-tailwindcss": {
35
- // Tailwind v4: path to the CSS file with `@import "tailwindcss"`
36
- entryPoint: "src/app/globals.css",
37
- // Tailwind v3 ONLY (omit for v4):
38
- // tailwindConfig: "tailwind.config.js",
39
- },
23
+ export default defineConfig({
24
+ // enable all recommended rules
25
+ extends: [eslintPluginBetterTailwindcss.configs.recommended],
26
+
27
+ settings: {
28
+ "better-tailwindcss": {
29
+ // tailwindcss 4: path to the CSS entry file (e.g. `src/global.css`)
30
+ entryPoint: "src/global.css",
31
+ // tailwindcss 3: path to the tailwind config (e.g. `tailwind.config.js`)
32
+ // tailwindConfig: "tailwind.config.js",
40
33
  },
41
34
  },
42
- ]);
43
- ```
44
-
45
- ## Gotchas
46
35
 
47
- - **`settings.entryPoint` is REQUIRED for Tailwind v4** — it points at the global CSS file
48
- containing `@import "tailwindcss"` (v4 has no JS config file). For v3, use `tailwindConfig`
49
- instead.
50
- - **Monorepo**: set `settings["better-tailwindcss"].cwd` per file-group so the plugin resolves
51
- `tailwindcss` + the config from the correct project dir when ESLint runs from the repo root.
52
- - Config presets: `recommended`, `correctness` (errors), `stylistic` (warnings); severity
53
- suffixes `-error` / `-warn`.
54
- - Non-JSX file types (Svelte/Vue/Astro/HTML) need the matching `languageOptions.parser`.
55
-
56
- ## CBP preset divergence
57
-
58
- There is **no** CBP `tailwind` DB preset — Tailwind linting is entirely manual. `tarkur`
59
- currently has no Tailwind ESLint rules; add the block above to lint class order/validity.
60
-
61
- ## Official docs
36
+ languageOptions: {
37
+ parserOptions: { ecmaFeatures: { jsx: true } },
38
+ },
39
+ });
40
+ ```
62
41
 
63
- - eslint-plugin-better-tailwindcss: https://github.com/schoero/eslint-plugin-better-tailwindcss
64
- - Settings: https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/settings/settings.md
42
+ ## Notes (from the official docs)
43
+
44
+ - The plugin is wired in via **`extends: [...configs.recommended]`** — the official docs do **not** use
45
+ a literal `plugins: {}` key.
46
+ - **Three configs**: `recommended` (both), `correctness`, `stylistic`. By default stylistic rules are
47
+ warnings, correctness rules are errors. Append `-error` / `-warn` to change severity (e.g.
48
+ `recommended-warn`).
49
+ - **`settings` is version-specific**:
50
+ - **Tailwind v4** → `entryPoint`: path to the CSS file containing `@import "tailwindcss"` (v4 has no
51
+ JS config file).
52
+ - **Tailwind v3** → `tailwindConfig`: path to `tailwind.config.js`. The docs state: *"For Tailwind
53
+ CSS v4 and the css based config, use the `entryPoint` option instead."*
54
+ - Both paths are relative to the working directory; both are optional with automatic fallback.
55
+ - Legacy `.eslintrc` config names are prefixed `legacy-` (e.g. `legacy-recommended`).
56
+ - Runs under your normal `npx eslint .` — no special command.
57
+
58
+ ## Source
59
+
60
+ - https://github.com/schoero/eslint-plugin-better-tailwindcss (README + `docs/parsers/*`, `docs/settings/settings.md`)
@@ -1,57 +1,48 @@
1
- # testing-react — Testing Library + jest-dom rules
1
+ # testing-react — Testing Library + jest-dom (official setup)
2
2
 
3
- For React component tests (Testing Library assertions). Layers a **test-scoped** override on
4
- top of [base](base.md) + the test-runner doc ([vitest](vitest.md) or [jest](jest.md)). Maps to
5
- the CBP **`testing-react`** DB preset
6
- (`tech_match.requires: ["React", "Vitest"]`, `requires_capabilities: ["jsx"]`).
3
+ > **Official sources** (verified 2026-05-31):
4
+ > - eslint-plugin-testing-library https://github.com/testing-library/eslint-plugin-testing-library
5
+ > - eslint-plugin-jest-dom https://github.com/testing-library/eslint-plugin-jest-dom
7
6
 
8
- > **Verified 2026-05-31.** Both plugins use bracketed `configs['flat/...']` keys and each
9
- > spreads its own plugin registration — keep them as **separate array entries**.
7
+ For React component tests. Each plugin ships its own framework-scoped flat config.
10
8
 
11
- ## Packages
12
-
13
- | Package | Latest | Purpose |
14
- | ------- | ------ | ------- |
15
- | `eslint-plugin-testing-library` | `7.16.2` | Testing Library best-practices |
16
- | `eslint-plugin-jest-dom` | `5.5.0` | `@testing-library/jest-dom` matchers |
9
+ ## Install
17
10
 
18
11
  ```bash
19
- pnpm add -D eslint-plugin-testing-library eslint-plugin-jest-dom
12
+ npm install --save-dev eslint-plugin-testing-library eslint-plugin-jest-dom
20
13
  ```
21
14
 
22
- ## Flat config
15
+ ## eslint.config.mjs (official examples)
23
16
 
24
17
  ```js
25
- // eslint.config.mjs
26
18
  import testingLibrary from "eslint-plugin-testing-library";
27
19
  import jestDom from "eslint-plugin-jest-dom";
28
20
 
29
- const TEST_GLOBS = ["**/*.{test,spec}.{ts,tsx,js,jsx}", "**/__tests__/**/*.{ts,tsx,js,jsx}"];
21
+ const TEST_GLOBS = [/* glob matching your test files */];
30
22
 
31
23
  export default [
32
- { files: TEST_GLOBS, ...testingLibrary.configs["flat/react"] }, // 'flat/dom' for non-React
33
- { files: TEST_GLOBS, ...jestDom.configs["flat/recommended"] },
24
+ {
25
+ files: TEST_GLOBS,
26
+ ...testingLibrary.configs["flat/react"], // 'flat/dom' for framework-agnostic
27
+ },
28
+ {
29
+ files: TEST_GLOBS,
30
+ ...jestDom.configs["flat/recommended"],
31
+ },
34
32
  ];
35
33
  ```
36
34
 
37
- ## Gotchas
38
-
39
- - Keep the two as **separate array entries** — each `...config` spread re-declares its own
40
- `plugins`. Merging them into one object means you must hand-combine `plugins` + `rules`.
41
- - `eslint-plugin-testing-library` framework presets: `flat/react`, `flat/dom` (agnostic),
42
- `flat/vue`, `flat/angular`, `flat/svelte`, `flat/marko` — pick **one**.
43
- - Scope to the **same test globs** as your runner override so the rules don't bleed onto
44
- production code.
45
- - Don't let Playwright e2e specs hit `testing-library/*` rules (e.g.
46
- `prefer-screen-queries` mis-fires on Playwright's `page.getByRole`) — scope to `src/**`
47
- unit tests, not the e2e dir (see [e2e.md](e2e.md)).
48
-
49
- ## CBP preset divergence
35
+ ## Notes (from the official docs)
50
36
 
51
- The CBP `testing-react` preset matches this (`eslint-plugin-testing-library: ^7.0.0`,
52
- `eslint-plugin-jest-dom: ^5.0.0`, `flat/react` + `flat/recommended`). No divergence.
37
+ - **Testing Library has NO aggregate `flat/recommended`** the flat configs are **framework-specific
38
+ only**: `flat/dom`, `flat/react`, `flat/angular`, `flat/vue`, `flat/svelte`, `flat/marko`. Pick one.
39
+ - **jest-dom** uses `configs["flat/recommended"]`.
40
+ - Both plugins require **you** to supply the test-file glob in `files` — they don't preset it.
41
+ - Both READMEs state their *primary* documentation still uses `.eslintrc`; the flat configs are the
42
+ `flat/`-prefixed alternatives.
43
+ - Keep these as **separate array entries** — each `...config` spread re-declares its own `plugins`.
53
44
 
54
- ## Official docs
45
+ ## Source
55
46
 
56
- - testing-library: https://github.com/testing-library/eslint-plugin-testing-library
57
- - jest-dom: https://github.com/testing-library/eslint-plugin-jest-dom
47
+ - https://github.com/testing-library/eslint-plugin-testing-library
48
+ - https://github.com/testing-library/eslint-plugin-jest-dom
@@ -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