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,63 +1,62 @@
1
- # nextjs — Next.js (App Router) flat config
1
+ # nextjs — Next.js (official eslint-config-next setup)
2
2
 
3
- For Next.js apps. Layers on top of [base](base.md). Maps to the CBP **`nextjs`** DB preset
4
- (`tech_match.requires: ["Next.js"]`, `requires_capabilities: ["jsx"]`).
3
+ > **Official source**: https://nextjs.org/docs/app/api-reference/config/eslint Next.js **16.2.6**,
4
+ > lastUpdated 2026-05-28. Native ESLint flat config. This is the official setup verbatim.
5
5
 
6
- > **Verified 2026-05-31.** As of **Next.js 16**, `eslint-config-next` ships **native flat
7
- > config**, `next lint` is **removed** (run `eslint .` directly), and the `eslint` key in
8
- > `next.config.js` is gone. No `FlatCompat` shim is needed.
9
-
10
- ## Packages
11
-
12
- | Package | Latest | Purpose |
13
- | ------- | ------ | ------- |
14
- | `eslint-config-next` | `16.2.6` | bundles `@next/eslint-plugin-next` + react/react-hooks/import |
6
+ ## Install
15
7
 
16
8
  ```bash
17
- pnpm add -D eslint-config-next
9
+ pnpm add -D eslint eslint-config-next
18
10
  ```
19
11
 
20
- ## Flat config
12
+ ## eslint.config.mjs — TypeScript app
21
13
 
22
- `eslint-config-next` exposes spreadable **array** subpath exports:
14
+ What `create-next-app --typescript` generates:
23
15
 
24
16
  ```js
25
- // eslint.config.mjs
26
17
  import { defineConfig, globalIgnores } from "eslint/config";
27
18
  import nextVitals from "eslint-config-next/core-web-vitals";
28
19
  import nextTs from "eslint-config-next/typescript";
29
20
 
30
- export default defineConfig([
31
- ...nextVitals, // base + Core-Web-Vitals rules promoted warn→error
32
- ...nextTs, // typescript-eslint rules (based on @typescript-eslint/recommended)
21
+ const eslintConfig = defineConfig([
22
+ ...nextVitals,
23
+ ...nextTs,
24
+ // Override default ignores of eslint-config-next.
33
25
  globalIgnores([".next/**", "out/**", "build/**", "next-env.d.ts"]),
34
26
  ]);
27
+
28
+ export default eslintConfig;
35
29
  ```
36
30
 
37
- Subpath exports:
38
- - `eslint-config-next` — base (Next + react + react-hooks recommended).
39
- - `eslint-config-next/core-web-vitals` — base + CWV rules at error (**recommended default**).
40
- - `eslint-config-next/typescript` — adds typescript-eslint rules; spread alongside a base.
31
+ JavaScript app: drop the `nextTs` import and the `...nextTs` spread.
41
32
 
42
- ## Gotchas
33
+ ## Run
43
34
 
44
- - **`globalIgnores([...])` is required** when you spread the config — re-assert the default
45
- ignores (`.next/`, etc.) per the official docs example.
46
- - **Monorepo**: point the plugin at the app with `settings: { next: { rootDir: "apps/web" } }`
47
- (path, glob, or array).
48
- - **Prettier**: add `import prettier from "eslint-config-prettier/flat"` last.
49
- - `next lint` removal landed in Next 16.0.0 — old `.eslintrc.json` configs should migrate to
50
- `eslint.config.mjs` (a codemod exists).
35
+ ```bash
36
+ npx eslint .
37
+ ```
38
+
39
+ ## The three official configs
51
40
 
52
- ## CBP preset divergence
41
+ - **`eslint-config-next`** base: Next.js + `eslint-plugin-react` + `eslint-plugin-react-hooks`
42
+ recommended rule-sets (JS + TS).
43
+ - **`eslint-config-next/core-web-vitals`** — base + promotes Core-Web-Vitals rules from warning to
44
+ error. Recommended default; auto-included by create-next-app.
45
+ - **`eslint-config-next/typescript`** — adds typescript-eslint rules (based on
46
+ `@typescript-eslint/recommended`); spread alongside one of the above.
53
47
 
54
- CBP's `nextjs` preset pins `eslint-config-next: ^15.0.0` and registers
55
- `eslint-plugin-react-compiler` explicitly (see [react.md](react.md) — that plugin is now
56
- **superseded**). The repo's own `apps/web/eslint.config.mjs` already uses the
57
- `createRequire` + `eslint-config-next/core-web-vitals` + `eslint-config-next/typescript`
58
- pattern. Adopt the native spread form above when regenerating; presets are not changed by
59
- this skill.
48
+ ## Notes (from the official docs)
49
+
50
+ - **`next lint` was removed in Next.js v16.0.0** (and the `eslint` option in `next.config.js`). Use
51
+ the ESLint CLI directly (`npx eslint .`). A codemod is available to migrate.
52
+ - **`globalIgnores([...])` is required** when you spread the config it re-asserts
53
+ eslint-config-next's default ignores.
54
+ - **Monorepo**: tell the plugin where the app is via `settings: { next: { rootDir: "packages/my-app/" } }`
55
+ (path, glob, or array).
56
+ - **Prettier**: install `eslint-config-prettier`, then add
57
+ `import prettier from "eslint-config-prettier/flat"` and include `prettier` in the array.
58
+ - **Disable rules**: append a `{ rules: { ... } }` object after the spreads.
60
59
 
61
- ## Official docs
60
+ ## Source
62
61
 
63
- - ESLint config: https://nextjs.org/docs/app/api-reference/config/eslint
62
+ - https://nextjs.org/docs/app/api-reference/config/eslint
@@ -1,74 +1,45 @@
1
- # node — Node/TypeScript service (Hono, Express, plain Node) flat config
1
+ # node — Node.js (official eslint-plugin-n setup)
2
2
 
3
- For Node back-end services and server-side packages (the CBP MCP server uses Hono; any
4
- `node-server` capability). Layers on [base](base.md). Maps to the CBP **`node`** DB preset
5
- (`tech_match.requires: ["Node.js"]`, `requires_capabilities: ["node-server"]`).
3
+ > **Official source**: https://github.com/eslint-community/eslint-plugin-n (verified 2026-05-31).
4
+ > ESLint flat config. This is the plugin's official setup verbatim.
6
5
 
7
- > **Verified 2026-05-31.** The valuable async-safety rules (`no-floating-promises`,
8
- > `no-misused-promises`) are **typescript-eslint** rules that need type info — they come from
9
- > `recommendedTypeChecked`, not from a node plugin.
6
+ For Node.js services and packages. `eslint-plugin-n` is the maintained Node plugin (successor to the
7
+ deprecated `eslint-plugin-node`).
10
8
 
11
- ## Packages
12
-
13
- | Package | Latest | Purpose |
14
- | ------- | ------ | ------- |
15
- | `globals` | `17.6.0` | `globals.node` |
16
- | `typescript-eslint` | `8.60.0` | type-aware promise rules |
17
- | `eslint-plugin-n` | `18.0.1` | **optional** — unsupported-Node-API / import / engines checks |
9
+ ## Install
18
10
 
19
11
  ```bash
20
- pnpm add -D globals typescript-eslint
21
- # optional (libraries / dual ESM-CJS packages):
22
- pnpm add -D eslint-plugin-n
12
+ npm install --save-dev eslint eslint-plugin-n
23
13
  ```
24
14
 
25
- ## Flat config
15
+ ## eslint.config.mjs — ES Modules
26
16
 
27
17
  ```js
28
- // eslint.config.mjs
18
+ import node from "eslint-plugin-n";
29
19
  import { defineConfig } from "eslint/config";
30
- import js from "@eslint/js";
31
- import tseslint from "typescript-eslint";
32
- import globals from "globals";
33
- // optional: import n from "eslint-plugin-n";
34
20
 
35
21
  export default defineConfig([
36
- js.configs.recommended,
37
- ...tseslint.configs.recommendedTypeChecked, // enables the promise rules below
38
22
  {
39
- files: ["**/*.{ts,mts,cts}"],
40
- languageOptions: {
41
- globals: globals.node,
42
- sourceType: "module", // "commonjs" for a CJS service
43
- parserOptions: { projectService: true, tsconfigRootDir: import.meta.dirname },
44
- },
45
- rules: {
46
- "@typescript-eslint/no-floating-promises": "error",
47
- "@typescript-eslint/no-misused-promises": "error",
48
- },
23
+ plugins: { n: node },
24
+ extends: ["n/recommended-module"],
49
25
  },
50
- // optional eslint-plugin-n:
51
- // { files: ["**/*.{ts,mts,cts}"], plugins: { n }, extends: ["n/recommended-module"] },
52
26
  ]);
53
27
  ```
54
28
 
55
- ## Gotchas
56
-
57
- - **`eslint-plugin-n` is optional.** For a pure internal TS service you can skip it — its main
58
- value is catching unsupported Node APIs, missing imports, and `package.json#engines` issues
59
- in **libraries** and dual ESM/CJS packages. Pick the right preset: `n/recommended-module`
60
- (ESM), `n/recommended-script` (CJS), `n/recommended` (mixed).
61
- - The promise rules **require** a type-checked config + `projectService` — they silently do
62
- nothing without type info.
63
- - A CJS service uses `sourceType: "commonjs"`; an ESM service uses `"module"`.
64
-
65
- ## CBP preset divergence
29
+ ## Notes (from the official docs)
66
30
 
67
- CBP's `node` preset ships only the two `@typescript-eslint` promise rules at `error` (no
68
- `eslint-plugin-n`). The repo's MCP server / CLI configs follow this minimal shape. Add
69
- `eslint-plugin-n` per-repo if you publish a library; the skill does not modify the preset.
31
+ - Preset variants (swap the `extends` value):
32
+ - **`n/recommended-module`** considers all files as ES Modules.
33
+ - **`n/recommended-script`** considers all files as CommonJS.
34
+ - **`n/recommended`** — handles both; uses `package.json` `"type"` plus `.mjs`/`.cjs` extensions to
35
+ decide how to treat each file.
36
+ - **`n/mixed-esm-and-cjs`** — for a package that mixes both.
37
+ - The README uses the `plugins: { n: node }` + `extends: [...]` form, which requires `defineConfig`
38
+ from `eslint/config`.
39
+ - For a TypeScript Node project, layer this on top of the official typescript-eslint setup
40
+ ([base.md](base.md)) — the type-aware promise rules (`no-floating-promises`, `no-misused-promises`)
41
+ come from typescript-eslint's `recommendedTypeChecked`, not from eslint-plugin-n.
70
42
 
71
- ## Official docs
43
+ ## Source
72
44
 
73
- - eslint-plugin-n: https://github.com/eslint-community/eslint-plugin-n
74
- - no-floating-promises: https://typescript-eslint.io/rules/no-floating-promises/
45
+ - https://github.com/eslint-community/eslint-plugin-n
@@ -1,60 +1,56 @@
1
- # react-native — React Native / Expo flat config
1
+ # react-native — Expo / React Native (official eslint-config-expo setup)
2
2
 
3
- For Expo / React Native apps (the CBP `livebyplan` mobile app). **Gap stack — no CBP DB
4
- preset.** Use Expo's official lint config.
3
+ > **Official source**: https://docs.expo.dev/guides/using-eslint/ (verified 2026-05-31). This is
4
+ > Expo's official ESLint setup verbatim. Flat config is the default from **Expo SDK 53** onward (SDK 52
5
+ > and earlier use legacy `.eslintrc`).
5
6
 
6
- > **Verified 2026-05-31.** `eslint-config-expo` is the official config and ships **flat config
7
- > by default from Expo SDK 53** onward (SDK 52 and earlier use legacy `.eslintrc`).
8
-
9
- ## Packages
10
-
11
- | Package | Latest | Purpose |
12
- | ------- | ------ | ------- |
13
- | `eslint-config-expo` | `56.0.4` | Expo's flat config (`/flat` subpath) |
7
+ ## Setup
14
8
 
15
9
  ```bash
16
- npx expo lint # installs eslint + eslint-config-expo and scaffolds eslint.config.js
10
+ npx expo lint
17
11
  ```
18
12
 
19
- `eslint-config-expo` bundles `eslint-plugin-expo`, `eslint-plugin-react`,
20
- `eslint-plugin-react-hooks`, `eslint-plugin-import`, and `@typescript-eslint/*`. It does **not**
21
- bundle `eslint-plugin-react-native` (that's a separate optional add-on, `@5.0.0`).
13
+ This generates an **`eslint.config.js`** that extends `eslint-config-expo` and installs the deps on
14
+ first run. Optional Prettier integration:
22
15
 
23
- ## Flat config
16
+ ```bash
17
+ npx expo install prettier eslint-config-prettier eslint-plugin-prettier --dev
18
+ ```
24
19
 
25
- Expo's template is **CommonJS `eslint.config.js`** (not `.mjs`):
20
+ ## eslint.config.js (official example, with Prettier)
26
21
 
27
22
  ```js
28
- // eslint.config.js
29
- const { defineConfig } = require("eslint/config");
30
- const expoConfig = require("eslint-config-expo/flat");
31
- const eslintPluginPrettierRecommended = require("eslint-plugin-prettier/recommended");
23
+ const { defineConfig } = require('eslint/config');
24
+ const expoConfig = require('eslint-config-expo/flat');
25
+ const eslintPluginPrettierRecommended = require('eslint-plugin-prettier/recommended');
32
26
 
33
27
  module.exports = defineConfig([
34
28
  expoConfig,
35
29
  eslintPluginPrettierRecommended,
36
- { ignores: ["dist/*"] },
30
+ {
31
+ ignores: ['dist/*'],
32
+ },
37
33
  ]);
38
34
  ```
39
35
 
40
- Minimal form (no Prettier): just `expoConfig` in the array.
36
+ The bare generated config simply extends `eslint-config-expo/flat`; the block above is the documented
37
+ full example including Prettier. Note Expo's template is **CommonJS `eslint.config.js`**.
41
38
 
42
- ## Gotchas
39
+ ## Run
43
40
 
44
- - RN platform support comes from RN global variables + platform file extensions
45
- (`.android.ts`, `.ios.ts`, `.web.ts`) and `eslint-plugin-expo` — **not** from
46
- `eslint-plugin-react-native`. Add `eslint-plugin-react-native@5.0.0` manually only if you
47
- want RN-specific rules (`no-inline-styles`, `no-unused-styles`).
48
- - Run linting with `npx expo lint` (it wires the config the first time).
49
- - Expo apps test with **Jest** — add the [jest.md](jest.md) override.
41
+ ```bash
42
+ npx expo lint
43
+ ```
50
44
 
51
- ## CBP preset divergence
45
+ ## Notes (from the official docs)
52
46
 
53
- There is **no** CBP `react-native`/`expo` DB preset, and the `react` preset `excludes`
54
- nothing for RN but is browser-globals oriented. Use `eslint-config-expo/flat` directly; the
55
- skill does not add a preset for this stack.
47
+ - **Flat config availability**: *"From SDK 53 onwards, the default ESLint config file uses the Flat
48
+ config format. For SDK 52 and earlier, the default ESLint config file uses legacy config and does not
49
+ support Flat config."*
50
+ - **Prettier**: after setup, *"when you run `npx expo lint`, anything that is not aligned with Prettier
51
+ formatting will be caught as an error."*
52
+ - **Performance**: for large projects, add a `.eslintignore` with `/.expo` and `node_modules`.
56
53
 
57
- ## Official docs
54
+ ## Source
58
55
 
59
- - Using ESLint in Expo: https://docs.expo.dev/guides/using-eslint/
60
- - eslint-config-expo: https://github.com/expo/expo/tree/main/packages/eslint-config-expo
56
+ - https://docs.expo.dev/guides/using-eslint/
@@ -1,82 +1,57 @@
1
- # react — standalone React (Vite, Tauri) flat config
1
+ # react — standalone React (official eslint-plugin-react + react-hooks + jsx-a11y)
2
2
 
3
- For React apps that are **not** Next.js (Vite SPA, Tauri desktop webview). Layers on
4
- [base](base.md). Maps to the CBP **`react`** DB preset
5
- (`tech_match.requires: ["React"]`, `excludes: ["Next.js"]`, `requires_capabilities: ["jsx"]`).
3
+ For React projects that are **not** Next.js (Vite, etc.). Each plugin ships its own official flat
4
+ config; compose them. Setup below uses the official config keys from each plugin's docs (verified
5
+ 2026-05-31).
6
6
 
7
- > **Verified 2026-05-31.** **Do NOT install `eslint-plugin-react-compiler`** — it is
8
- > superseded. React Compiler v1.0 (Oct 2025) merged the compiler lint rules into
9
- > **`eslint-plugin-react-hooks@7`** under `configs.flat["recommended-latest"]`.
7
+ > **Official sources**:
8
+ > - eslint-plugin-react https://github.com/jsx-eslint/eslint-plugin-react
9
+ > - react-hooks https://react.dev/reference/eslint-plugin-react-hooks
10
+ > - jsx-a11y — https://github.com/jsx-eslint/eslint-plugin-jsx-a11y
10
11
 
11
- ## Packages
12
-
13
- | Package | Latest | Purpose |
14
- | ------- | ------ | ------- |
15
- | `eslint-plugin-react` | `7.37.5` | React rules + JSX parsing (`configs.flat.*`) |
16
- | `eslint-plugin-react-hooks` | `7.1.1` | hooks rules **+ bundled React Compiler rules** |
17
- | `eslint-plugin-jsx-a11y` | `6.10.2` | accessibility (`flatConfigs.*` — note plural) |
12
+ ## Install
18
13
 
19
14
  ```bash
20
- pnpm add -D eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-jsx-a11y globals
15
+ npm install --save-dev eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-jsx-a11y globals
21
16
  ```
22
17
 
23
- ## Flat config
18
+ ## eslint.config.mjs
24
19
 
25
20
  ```js
26
- // eslint.config.mjs
27
- import { defineConfig } from "eslint/config";
28
21
  import react from "eslint-plugin-react";
29
22
  import reactHooks from "eslint-plugin-react-hooks";
30
23
  import jsxA11y from "eslint-plugin-jsx-a11y";
31
24
  import globals from "globals";
25
+ import { defineConfig } from "eslint/config";
32
26
 
33
27
  export default defineConfig([
34
- react.configs.flat.recommended, // namespaced react/, enables JSX parsing
35
- react.configs.flat["jsx-runtime"], // React 17+ automatic JSX transform
36
- reactHooks.configs.flat["recommended-latest"], // hooks + React Compiler rules
37
- jsxA11y.flatConfigs.strict, // or flatConfigs.recommended
28
+ react.configs.flat.recommended, // eslint-plugin-react recommended
29
+ react.configs.flat["jsx-runtime"], // React 17+ automatic JSX transform
30
+ reactHooks.configs.flat.recommended, // rules-of-hooks + exhaustive-deps
31
+ jsxA11y.flatConfigs.recommended, // accessibility (or .strict)
38
32
  {
39
- files: ["**/*.{js,jsx,ts,tsx}"],
40
- languageOptions: { globals: globals.browser },
33
+ // eslint-plugin-react and jsx-a11y do NOT preset files/globals — set them yourself.
34
+ files: ["**/*.{js,mjs,cjs,jsx,ts,tsx}"],
35
+ languageOptions: { globals: { ...globals.browser } },
41
36
  settings: { react: { version: "detect" } },
42
37
  },
43
38
  ]);
44
39
  ```
45
40
 
46
- ## Gotchas
47
-
48
- - **`eslint-plugin-react` flat configs do not set `files` or globals** — add your own
49
- `files`/`globals.browser`/`settings.react.version` object (shown above) or you'll get the
50
- "React version not specified" warning and no JSX globals.
51
- - **`eslint-plugin-react-hooks` v7 keys** live under `configs.flat.*`:
52
- `recommended` (standard hooks) vs `recommended-latest` (hooks **+ compiler** rules — use
53
- this for React 19 + the compiler).
54
- - **`jsx-a11y` uses `flatConfigs` (plural)** — `jsxA11y.flatConfigs.strict`, a different
55
- namespace from react's `configs.flat`.
56
-
57
- ## Storybook (bonus)
58
-
59
- If the app uses Storybook, add `eslint-plugin-storybook@10.4.1`:
60
-
61
- ```js
62
- import storybook from "eslint-plugin-storybook";
63
- // ...spread into the array:
64
- ...storybook.configs["flat/recommended"],
65
- ```
66
-
67
- The standalone plugin repo was archived (2025-11); it now lives in the Storybook monorepo but
68
- the npm name `eslint-plugin-storybook` is unchanged.
69
-
70
- ## CBP preset divergence
41
+ ## Notes (from the official docs)
71
42
 
72
- CBP's `react` preset still depends on `eslint-plugin-react-compiler: ^19.0.0` and registers
73
- `react-compiler/react-compiler`. The latest guidance removes that plugin and relies on
74
- `eslint-plugin-react-hooks@7`'s `recommended-latest`. Adopt that when regenerating; the skill
75
- does not modify the preset.
43
+ - eslint-plugin-react and jsx-a11y: *"Our shareable configs do NOT configure `files` or
44
+ `languageOptions.globals`"* you must add them yourself (shown above).
45
+ - For React 17+, add `react.configs.flat["jsx-runtime"]` to disable the old "React must be in scope"
46
+ rules.
47
+ - **react-hooks**: `configs.flat.recommended` is the standard. The plugin also exposes
48
+ `configs.flat["recommended-latest"]`, which the React team describes as *"bleeding edge experimental
49
+ compiler rules"* (the React Compiler rules are bundled into `eslint-plugin-react-hooks`). Opt in only
50
+ if you want them.
51
+ - **jsx-a11y** exposes `flatConfigs.recommended` and `flatConfigs.strict`.
52
+ - eslint-plugin-react's README writes its examples in CommonJS (`require`/`module.exports`); the config
53
+ keys above are identical in ESM.
76
54
 
77
- ## Official docs
55
+ ## Source
78
56
 
79
- - eslint-plugin-react: https://github.com/jsx-eslint/eslint-plugin-react
80
- - react-hooks: https://react.dev/reference/eslint-plugin-react-hooks
81
- - React Compiler v1.0: https://react.dev/blog/2025/10/07/react-compiler-1
82
- - jsx-a11y: https://github.com/jsx-eslint/eslint-plugin-jsx-a11y
57
+ See the three URLs above.
@@ -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