@peerigon/configs 14.7.0 → 14.9.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,15 @@
|
|
|
1
|
+
# [14.9.0](https://github.com/peerigon/configs/compare/v14.8.0...v14.9.0) (2026-03-18)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
- **ai:** Improve testing styleguide ([cc07dfd](https://github.com/peerigon/configs/commit/cc07dfd46e24f747ad06b3fc2f79e923872f6c94))
|
|
6
|
+
|
|
7
|
+
# [14.8.0](https://github.com/peerigon/configs/compare/v14.7.0...v14.8.0) (2026-03-16)
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
- **ai:** Apply best practices from "A Philosophy of Software Design" ([ad5f17d](https://github.com/peerigon/configs/commit/ad5f17dfc6534196fb65813682a2a429f7eb0495))
|
|
12
|
+
|
|
1
13
|
# [14.7.0](https://github.com/peerigon/configs/compare/v14.6.0...v14.7.0) (2026-03-16)
|
|
2
14
|
|
|
3
15
|
### Features
|
|
@@ -100,7 +100,9 @@ globs: **/*.js, **/*.ts, **/*.mjs, **/*.cjs, **/*.mts, **/*.cts
|
|
|
100
100
|
|
|
101
101
|
## Comments
|
|
102
102
|
|
|
103
|
-
- Use
|
|
103
|
+
- Use comments to explain why, invariants, constraints, and non-obvious trade-offs
|
|
104
|
+
- Do not write comments that only restate what the code already makes obvious
|
|
105
|
+
- Add short contract comments only for complex or high-impact exports. Focus on purpose, guarantees, and important caveats.
|
|
104
106
|
|
|
105
107
|
## Testing
|
|
106
108
|
|
|
@@ -9,6 +9,7 @@ globs: **/*.tsx, **/*.jsx
|
|
|
9
9
|
- Inline component props next to the component prop argument
|
|
10
10
|
- Derive state where possible
|
|
11
11
|
- Avoid unnecessary `useState` and `useEffect`
|
|
12
|
-
- `useEffect`
|
|
12
|
+
- Use `useEffect` only when synchronizing with external systems (for example browser APIs, subscriptions, timers, network interactions)
|
|
13
|
+
- Keep effects small, deterministic, and cleanup-safe
|
|
13
14
|
- Avoid `useMemo` and `useCallback` unless its absolutely necessary
|
|
14
15
|
- Create a story for each React component if Storybook is used
|
|
@@ -7,10 +7,12 @@ globs: **/*.test.js, **/*.test.ts, **/*.test.tsx
|
|
|
7
7
|
|
|
8
8
|
## General principle
|
|
9
9
|
|
|
10
|
-
**Important**:
|
|
10
|
+
**Important**: Aim for the smallest high-value test set that protects behavior, interface contracts, invariants, and regression-prone paths. Focus on testing behavior rather than implementation details.
|
|
11
11
|
|
|
12
12
|
## Structure & Organization
|
|
13
13
|
|
|
14
|
+
- Order of tests: Match the order of tests to the order of symbols in the source file
|
|
15
|
+
- One describe per export: Provide a describe block for each exported symbol (function, class, constant)
|
|
14
16
|
- Hierarchical grouping: Use nested describe() blocks - outer for function/class, inner for scenarios
|
|
15
17
|
- Logical categorization: Group by behavior, input type, or state (e.g., "with valid input", "error handling")
|
|
16
18
|
- Each it() should test a single behavior
|
|
@@ -27,6 +29,7 @@ globs: **/*.test.js, **/*.test.ts, **/*.test.tsx
|
|
|
27
29
|
|
|
28
30
|
- Type annotations: Include explicit types in test variables to verify inference
|
|
29
31
|
- Compile-time checks: Some tests exist just to verify type compatibility
|
|
32
|
+
- Type tests for generics: Add type tests for generic functions, classes, etc. Use the test runner's type testing tool when available (e.g. with Vitest: `expectTypeOf`)
|
|
30
33
|
|
|
31
34
|
## Best Practices
|
|
32
35
|
|
package/ai/rules.mdc
CHANGED
|
@@ -14,6 +14,12 @@ alwaysApply: true
|
|
|
14
14
|
- Prefer explicit over implicit
|
|
15
15
|
- Keep code close together that belongs together
|
|
16
16
|
|
|
17
|
+
## Complexity and module design
|
|
18
|
+
|
|
19
|
+
- Treat complexity as the primary enemy. Prefer designs that reduce mental load, special cases, and cross-module coupling.
|
|
20
|
+
- Prefer deep modules with shallow interfaces: expose minimal API surface and hide implementation details by default.
|
|
21
|
+
- Avoid pass-through abstractions that add layers but do not hide meaningful complexity.
|
|
22
|
+
|
|
17
23
|
## JavaScript & TypeScript
|
|
18
24
|
|
|
19
25
|
See [Coding Styleguide JavaScript & TypeScript](./coding-styleguide-js-ts.mdc)
|
|
@@ -37,7 +43,7 @@ See [Coding Styleguide Shell Scripts](./coding-styleguide-sh.mdc)
|
|
|
37
43
|
- Write unit tests for simple, pure functions
|
|
38
44
|
- Unit test files are colocated with source files (\*.test.ts)
|
|
39
45
|
- Write integration or e2e tests for more complex functions/classes/components
|
|
40
|
-
-
|
|
46
|
+
- Prefer staged validation for non-trivial tasks: run focused checks after meaningful changes, then run broader lint/type/test checks before handoff. For trivial tasks, a single final validation is acceptable.
|
|
41
47
|
- Adjust documentation both in comments and markdown files once you're done
|
|
42
48
|
|
|
43
49
|
## Consumer-repo uncertainty protocol
|