@peerigon/configs 14.5.0 → 14.7.0

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/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ # [14.7.0](https://github.com/peerigon/configs/compare/v14.6.0...v14.7.0) (2026-03-16)
2
+
3
+ ### Features
4
+
5
+ - **ai:** Improve agent instructions for large repos ([89e8298](https://github.com/peerigon/configs/commit/89e82983d9a13439cc75e90b41cc2f13c345b5c8))
6
+ - Update dependencies ([ee6e1ed](https://github.com/peerigon/configs/commit/ee6e1ed3fc64563792437ab102e0dacbc9e6ca24))
7
+
8
+ # [14.6.0](https://github.com/peerigon/configs/compare/v14.5.0...v14.6.0) (2026-03-15)
9
+
10
+ ### Features
11
+
12
+ - **eslint:** Disable no-unreachable-loop in tests ([4638cb2](https://github.com/peerigon/configs/commit/4638cb20ca44cd2455319138141b51ef08299e55))
13
+
1
14
  # [14.5.0](https://github.com/peerigon/configs/compare/v14.4.0...v14.5.0) (2026-03-10)
2
15
 
3
16
  ### Features
package/ai/README.md CHANGED
@@ -12,6 +12,9 @@ Put this in your project-specific rules file (like `CLAUDE.md`, `.cursor/rules.m
12
12
  **Important**: You **must** follow [these rules](./node_modules/@peerigon/configs/ai/rules.mdc) and its language-specific rules referenced in that file.
13
13
  ```
14
14
 
15
+ For large repositories, we recommend maintaining a repo-level routing document at `docs/agent-routing.md` to help agents find the right entrypoints quickly.
16
+ You can start from [`agent-routing.example.md`](./agent-routing.example.md) and adapt it to your needs.
17
+
15
18
  ## Migration Guide
16
19
 
17
20
  [`migrate-to.md`](./migrate-to.md) provides step-by-step instructions for coding agents for migrating projects to use `@peerigon/configs`.
@@ -0,0 +1,41 @@
1
+ # Agent Routing
2
+
3
+ Use this file as a fast index for coding agents in large repositories. Keep entries short and practical.
4
+
5
+ ## Scope
6
+
7
+ Describe the repository purpose in 2-4 lines.
8
+
9
+ ## Quick task map
10
+
11
+ - "<task type>" -> `<path-a>`, `<path-b>`, `<path-c>`
12
+ - "Add or modify API endpoint" -> `src/api/*`, `src/routes/*`, `tests/api/*`
13
+ - "UI component change" -> `src/components/*`, `src/pages/*`, `*.stories.*`
14
+ - "Build or release change" -> `package.json`, `.github/workflows/*`, `semantic-release/*`
15
+
16
+ ## Entry points by area
17
+
18
+ ### Authentication
19
+
20
+ - Start reading: `src/auth/index.ts`
21
+ - Core flow: `src/auth/service.ts`
22
+ - Tests: `src/auth/*.test.ts`
23
+
24
+ ### Data layer
25
+
26
+ - Start reading: `src/db/client.ts`
27
+ - Migrations: `db/migrations/*`
28
+ - Contract tests: `tests/db/*`
29
+
30
+ ## Validation commands
31
+
32
+ - Unit (scoped): `npm run test -- <path>`
33
+ - Types: `npm run test:types`
34
+ - Lint: `npm run test:lint`
35
+ - Full: `npm test && npm run build`
36
+
37
+ ## Known traps
38
+
39
+ - "Import style is extensionless in app packages."
40
+ - "Feature flags are defined in `src/flags.ts`."
41
+ - "Integration tests require `.env.test`."
@@ -8,6 +8,7 @@ globs: **/*.js, **/*.ts, **/*.mjs, **/*.cjs, **/*.mts, **/*.cts
8
8
  - Use TypeScript. If .js files are requested, use JSDoc type annotations
9
9
  - Prefer functional over imperative
10
10
  - Prefer immutability
11
+ - **Priority rule (MUST)**: order every file by importance. Start with the primary logic and keep less important helpers/details at the end.
11
12
 
12
13
  ## Formatting
13
14
 
@@ -16,17 +17,21 @@ globs: **/*.js, **/*.ts, **/*.mjs, **/*.cjs, **/*.mts, **/*.cts
16
17
  ## Imports & exports
17
18
 
18
19
  - Use ESM unless you're editing a CommonJS file
19
- - Use file extensions in import specifiers. Use .ts extension in TypeScript files.
20
+ - Follow the consuming repository's established import-specifier convention (extensions vs extensionless; `.js` vs `.ts` in TypeScript source files)
21
+ - Determine convention from nearby files and configuration before introducing new imports
22
+ - Keep import style consistent within a module/package; avoid mixed styles unless already established
23
+ - If conventions are unclear or conflicting, ask the user before changing or introducing import-specifier style
20
24
  - Avoid default imports and default exports
21
25
  - Avoid barrel files (index files that only re-export) unless its a package entry file
22
26
 
23
27
  ## File structure
24
28
 
25
- - Begin with a `@module` overview JSDoc comment (**not** for test or config files)
29
+ - Do not add a file header comment by default
30
+ - For complex or high-impact files only, add a short context comment near the top (3-6 lines) that explains purpose, where to start reading, and non-obvious caveats
26
31
  - Then imports
27
32
  - Then important top-level constants or variables
28
- - Then order by importance (in relation to the file purpose): the most important classes/functions of the file should be at the beginning
29
- - Unimportant helper functions and variables should be at the bottom of the file
33
+ - Then order by importance (in relation to the file purpose): the file **must** start with its most important classes/functions
34
+ - Move unimportant helper functions, variables, and secondary details to the bottom of the file
30
35
  - Exception: when module execution requires a function to be defined before it is used, define it earlier
31
36
 
32
37
  ## Naming Conventions
package/ai/rules.mdc CHANGED
@@ -33,9 +33,34 @@ See [Coding Styleguide Shell Scripts](./coding-styleguide-sh.mdc)
33
33
  ## Development Practices
34
34
 
35
35
  - Breakdown complex tasks into smaller, manageable todos and write them down to a dedicated TODO file
36
- - Aim for small pull-requests. Each TODO should be a single pull-request. Use stacked PRs.
36
+ - Aim for small, reviewable pull-requests. Split work into logical units, and use stacked PRs when scope or risk justifies incremental review.
37
37
  - Write unit tests for simple, pure functions
38
- - Unit test files are colocated with source files (*.test.ts)
38
+ - Unit test files are colocated with source files (\*.test.ts)
39
39
  - Write integration or e2e tests for more complex functions/classes/components
40
40
  - Run the linter and type checker only once after the implementation is complete and the tests are passing
41
- - Adjust documentation both in comments and markdown files once you're done
41
+ - Adjust documentation both in comments and markdown files once you're done
42
+
43
+ ## Consumer-repo uncertainty protocol
44
+
45
+ Some guidance depends on the consuming repository's runtime and toolchain (module resolution, transpilation, bundler, test runner).
46
+
47
+ - First infer conventions from local evidence:
48
+ - nearby files and existing import style
49
+ - tsconfig compiler options
50
+ - eslint and import rules
51
+ - package scripts and build tooling
52
+ - If evidence is insufficient or conflicting, ask one concise question before changing conventions.
53
+ - Do not silently introduce a new convention in a mixed or unknown setup.
54
+ - If no answer is possible, follow the closest existing local convention and explicitly document the assumption.
55
+
56
+ ## Repo-level routing system
57
+
58
+ To reduce exploration cost in large repositories, use a repo-level routing document.
59
+
60
+ - Preferred path in consuming repositories: `docs/agent-routing.md` (or the nearest existing equivalent).
61
+ - Use `@peerigon/configs/ai/agent-routing.example.md` as a starting structure and adapt it to the consuming repository.
62
+ - At task start, check whether routing exists.
63
+ - If routing is missing and the task is non-trivial, create an initial routing file before implementation. If local policy may restrict docs changes, ask one concise question first.
64
+ - Use routing-first navigation: read the relevant routing section before broad codebase exploration.
65
+ - Keep routing concise and practical. Update it when better entrypoints, caveats, or validation commands are discovered.
66
+ - Do not duplicate full architecture docs. Routing should be an index for fast task orientation.
@@ -151,6 +151,8 @@ export const javascript = [
151
151
  "max-nested-callbacks": "off",
152
152
  // await in loops is pretty common in Playwright tests
153
153
  "no-await-in-loop": "off",
154
+ // Unreachable loops are sometimes used in tests to assert loop body runs at most once
155
+ "no-unreachable-loop": "off",
154
156
  // In case you want to test errors thrown by a constructor
155
157
  "no-new": "off",
156
158
  // Generators without yield are common in test helpers/setup
@@ -2,7 +2,6 @@
2
2
  import reactPlugin2 from "@eslint-react/eslint-plugin";
3
3
  import jsxA11yPlugin from "eslint-plugin-jsx-a11y";
4
4
  import reactPlugin from "eslint-plugin-react";
5
- import reactCompilerPlugin from "eslint-plugin-react-compiler";
6
5
  import reactHooksPlugin from "eslint-plugin-react-hooks";
7
6
  import reactRefreshPlugin from "eslint-plugin-react-refresh";
8
7
  import reactYouMightNotNeedAnEffect from "eslint-plugin-react-you-might-not-need-an-effect";
@@ -66,28 +65,9 @@ export const react = [
66
65
  ],
67
66
  },
68
67
  },
69
- // There's currently no official recommended flat config for react-hooks.
70
- // TODO: Use recommended config when it's available.
71
68
  {
72
69
  files,
73
- plugins: {
74
- "react-hooks": reactHooksPlugin,
75
- },
76
- rules: {
77
- "react-hooks/rules-of-hooks": "error",
78
- "react-hooks/exhaustive-deps": "warn",
79
- },
80
- },
81
- // There's currently no official recommended flat config for react-compiler.
82
- // TODO: Use recommended config when it's available.
83
- {
84
- files,
85
- plugins: {
86
- "react-compiler": reactCompilerPlugin,
87
- },
88
- rules: {
89
- "react-compiler/react-compiler": "error",
90
- },
70
+ ...reactHooksPlugin.configs.flat.recommended,
91
71
  },
92
72
  {
93
73
  files,
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ import assert from "node:assert/strict";
2
+ import reactHooksPlugin from "eslint-plugin-react-hooks";
3
+ import { react } from "./react.js";
4
+ const reactHooksConfigs = react.filter((config) => config.rules &&
5
+ typeof config.rules === "object" &&
6
+ "react-hooks/rules-of-hooks" in config.rules);
7
+ assert.equal(reactHooksConfigs.length, 1, "react config should include exactly one react-hooks recommended config entry");
8
+ assert.deepEqual(reactHooksConfigs[0]?.rules, reactHooksPlugin.configs.flat.recommended.rules, "react config should mirror eslint-plugin-react-hooks flat recommended rules");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peerigon/configs",
3
- "version": "14.5.0",
3
+ "version": "14.7.0",
4
4
  "description": "Configs for ESLint, Prettier, TypeScript & friends",
5
5
  "keywords": [
6
6
  "eslint",
@@ -79,25 +79,24 @@
79
79
  },
80
80
  "dependencies": {
81
81
  "@eslint-react/eslint-plugin": "^2.13.0",
82
- "@eslint/compat": "^2.0.2",
82
+ "@eslint/compat": "^2.0.3",
83
83
  "@eslint/js": "^9.39.1",
84
84
  "@ianvs/prettier-plugin-sort-imports": "^4.7.1",
85
85
  "@prettier/plugin-oxc": "^0.1.3",
86
- "@sebbo2002/semantic-release-jsr": "^3.2.0",
86
+ "@sebbo2002/semantic-release-jsr": "^3.2.1",
87
87
  "@semantic-release/changelog": "^6.0.3",
88
88
  "@semantic-release/exec": "^7.1.0",
89
89
  "@semantic-release/git": "^10.0.1",
90
90
  "@tanstack/eslint-plugin-query": "^5.91.4",
91
91
  "@types/eslint-config-prettier": "^6.11.3",
92
92
  "@types/eslint-plugin-jsx-a11y": "^6.10.1",
93
- "@vitest/eslint-plugin": "^1.6.9",
93
+ "@vitest/eslint-plugin": "^1.6.12",
94
94
  "eslint-config-prettier": "^10.1.8",
95
95
  "eslint-plugin-jsx-a11y": "^6.10.2",
96
96
  "eslint-plugin-no-only-tests": "^3.3.0",
97
- "eslint-plugin-playwright": "^2.8.0",
97
+ "eslint-plugin-playwright": "^2.10.0",
98
98
  "eslint-plugin-prefer-arrow": "^1.2.3",
99
99
  "eslint-plugin-react": "^7.37.5",
100
- "eslint-plugin-react-compiler": "^19.1.0-rc.2",
101
100
  "eslint-plugin-react-hooks": "^7.0.1",
102
101
  "eslint-plugin-react-refresh": "^0.5.2",
103
102
  "eslint-plugin-react-you-might-not-need-an-effect": "^0.9.1",
@@ -105,18 +104,18 @@
105
104
  "globals": "^17.4.0",
106
105
  "prettier-plugin-css-order": "^2.2.0",
107
106
  "prettier-plugin-jsdoc": "^1.8.0",
108
- "prettier-plugin-packagejson": "^3.0.0",
107
+ "prettier-plugin-packagejson": "^3.0.2",
109
108
  "prettier-plugin-tailwindcss": "^0.7.2",
110
- "typescript-eslint": "^8.56.0"
109
+ "typescript-eslint": "^8.57.0"
111
110
  },
112
111
  "devDependencies": {
113
112
  "@types/jest": "^30.0.0",
114
- "@types/node": "^25.3.0",
113
+ "@types/node": "^25.5.0",
115
114
  "@types/react": "^19.2.14",
116
115
  "@types/signale": "^1.4.7",
117
116
  "eslint": "^9.39.1",
118
117
  "husky": "^9.1.7",
119
- "lint-staged": "^16.3.1",
118
+ "lint-staged": "^16.4.0",
120
119
  "npm-run-all2": "^8.0.4",
121
120
  "pin-github-action": "^3.4.0",
122
121
  "prettier": "^3.8.1",