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,69 +1,68 @@
1
- # nestjs — NestJS back-end flat config
1
+ # nestjs — NestJS (official starter ESLint config)
2
2
 
3
- For NestJS apps (the CBP `apps/backend`). **Gap stack — no CBP DB preset.** Use this doc to
4
- hand-author `eslint.config.mjs`; the `base` + `node` presets cover most of it, but the
5
- official Nest starter has a specific shape worth matching.
3
+ > **Official source**: https://github.com/nestjs/typescript-starter/blob/master/eslint.config.mjs
4
+ > (verified 2026-05-31). This is the `eslint.config.mjs` the official Nest starter ships, **verbatim**.
6
5
 
7
- > **Verified 2026-05-31.** There is **no first-party NestJS ESLint plugin** — the official
8
- > `nest new` starter uses plain type-checked `typescript-eslint` + Prettier.
6
+ NestJS has no first-party ESLint plugin — the official starter uses type-checked typescript-eslint +
7
+ Prettier.
9
8
 
10
- ## Packages
11
-
12
- | Package | Latest | Purpose |
13
- | ------- | ------ | ------- |
14
- | `typescript-eslint` | `8.60.0` | parser + type-checked preset |
15
- | `@eslint/js` | `10.0.1` | `eslint.configs.recommended` |
16
- | `eslint-plugin-prettier` | `^5` | `/recommended` subpath |
17
- | `globals` | `17.6.0` | `globals.node`, `globals.jest` |
9
+ ## Install
18
10
 
19
11
  ```bash
20
- pnpm add -D typescript-eslint @eslint/js eslint-plugin-prettier eslint-config-prettier globals
12
+ npm install --save-dev eslint @eslint/js typescript-eslint eslint-plugin-prettier eslint-config-prettier globals
21
13
  ```
22
14
 
23
- ## Flat config (official `nest new` starter, verbatim)
15
+ ## eslint.config.mjs (official `nest new` starter, verbatim)
24
16
 
25
17
  ```js
26
18
  // @ts-check
27
- import eslint from "@eslint/js";
28
- import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
29
- import globals from "globals";
30
- import tseslint from "typescript-eslint";
19
+ import eslint from '@eslint/js';
20
+ import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
21
+ import globals from 'globals';
22
+ import tseslint from 'typescript-eslint';
31
23
 
32
24
  export default tseslint.config(
33
- { ignores: ["eslint.config.mjs"] },
25
+ {
26
+ ignores: ['eslint.config.mjs'],
27
+ },
34
28
  eslint.configs.recommended,
35
29
  ...tseslint.configs.recommendedTypeChecked,
36
30
  eslintPluginPrettierRecommended,
37
31
  {
38
32
  languageOptions: {
39
- globals: { ...globals.node, ...globals.jest },
40
- sourceType: "commonjs", // "module" for an ESM Nest app
41
- parserOptions: { projectService: true, tsconfigRootDir: import.meta.dirname },
33
+ globals: {
34
+ ...globals.node,
35
+ ...globals.jest,
36
+ },
37
+ sourceType: 'commonjs',
38
+ parserOptions: {
39
+ projectService: true,
40
+ tsconfigRootDir: import.meta.dirname,
41
+ },
42
42
  },
43
43
  },
44
44
  {
45
45
  rules: {
46
- "@typescript-eslint/no-explicit-any": "off",
47
- "@typescript-eslint/no-floating-promises": "warn",
48
- "@typescript-eslint/no-unsafe-argument": "warn",
49
- "prettier/prettier": ["error", { endOfLine: "auto" }],
46
+ '@typescript-eslint/no-explicit-any': 'off',
47
+ '@typescript-eslint/no-floating-promises': 'warn',
48
+ '@typescript-eslint/no-unsafe-argument': 'warn',
49
+ 'prettier/prettier': ['error', { endOfLine: 'auto' }],
50
50
  },
51
51
  },
52
52
  );
53
53
  ```
54
54
 
55
- ## Gotchas
55
+ ## Notes (from the official starter file)
56
56
 
57
- - Nest relaxes three type-checked rules (`no-explicit-any` off; `no-floating-promises` and
58
- `no-unsafe-argument` to `warn`) because its DI/decorator patterns trip them. Keep these.
59
- - `{ ignores: ["eslint.config.mjs"] }` keeps type-aware linting off the config file itself.
60
- - `sourceType: "commonjs"` matches Nest's default CJS build flip to `"module"` for ESM.
61
- - The starter still uses `tseslint.config(...)`; you may swap it for `defineConfig` from
62
- `eslint/config` (deprecation note in [base.md](base.md)) the presets are identical.
63
- - Optional community add-on: `@darraghor/eslint-plugin-nestjs-typed` adds
64
- decorator/Swagger/DTO-aware rules. Not part of the official starter.
65
- - Nest tests use **Jest** — add the [jest.md](jest.md) override scoped to `**/*.spec.ts`.
57
+ - This is the one official config that wraps with **`tseslint.config(...)`** (not `defineConfig`). It
58
+ imports `@eslint/js` as `eslint` (so `eslint.configs.recommended`) and spreads
59
+ `...tseslint.configs.recommendedTypeChecked` (it's an array).
60
+ - `{ ignores: ['eslint.config.mjs'] }` keeps type-aware linting off the config file itself.
61
+ - `sourceType: 'commonjs'` matches Nest's default CJS build switch to `'module'` for an ESM Nest app.
62
+ - The starter deliberately relaxes three type-checked rules (`no-explicit-any` off;
63
+ `no-floating-promises` and `no-unsafe-argument` to `warn`) for Nest's DI/decorator patterns, and adds
64
+ Prettier via `eslint-plugin-prettier/recommended`.
66
65
 
67
- ## Official docs
66
+ ## Source
68
67
 
69
- - Starter config: https://github.com/nestjs/typescript-starter/blob/master/eslint.config.mjs
68
+ - https://github.com/nestjs/typescript-starter/blob/master/eslint.config.mjs
@@ -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.