peer-ai-standards 1.0.0-next.13 → 1.0.0-next.15

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,5 +1,27 @@
1
1
  # peer-ai-standards
2
2
 
3
+ ## 1.0.0-next.15
4
+
5
+ ### Minor Changes
6
+
7
+ - f217df4: Two new rules (RFC 0019, for #202):
8
+
9
+ - **REACT-11: a hook is called by its own name, never passed around as a value.** It's enforced by ESLint's `react-hooks/hooks`, which `peer-ai-eslint-config` turns on for React, React Native and Next.js parts, and catches a hook passed as an argument. `code-review` reads for what the tool can't see: a hook renamed, passed as a prop, or kept in an object. Under the React Compiler, each breaks the component on a later render.
10
+ - **TEST-12: tests run the code the build ships,** with the same compiler, transforms and flags, such as the React Compiler. Where a test runner can't, an end-to-end check of the built app covers the difference. `test-strategy` checks it for the project, `code-review` for a change to the build or test settings, and `qa-acceptance` for an item that adds a compiler or transform.
11
+
12
+ `code-review` also gains a guide for CODE-16, the framework's own rules: a tool's check counts as evidence only when it runs for the file.
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies [2a0e5e1]
17
+ - peer-ai-workflow@1.0.0-next.15
18
+
19
+ ## 1.0.0-next.14
20
+
21
+ ### Patch Changes
22
+
23
+ - peer-ai-workflow@1.0.0-next.14
24
+
3
25
  ## 1.0.0-next.13
4
26
 
5
27
  ### Patch Changes
@@ -48,4 +48,14 @@ export declare const testing: ({
48
48
  stage: "production";
49
49
  check: "ai-review";
50
50
  severity: "medium";
51
+ } | {
52
+ id: string;
53
+ domain: "testing";
54
+ title: string;
55
+ rule: string;
56
+ why: string;
57
+ ask: string;
58
+ stage: "mvp";
59
+ check: "ai-review";
60
+ severity: "high";
51
61
  })[];
@@ -121,4 +121,15 @@ export const testing = [
121
121
  check: "ai-review",
122
122
  severity: "medium",
123
123
  },
124
+ {
125
+ id: "TEST-12",
126
+ domain: "testing",
127
+ title: "Tests run the code the build ships",
128
+ rule: "Unit and component tests run the code through the same compiler, transforms and flags as the build that ships, such as the React Compiler or a Babel plugin. Where a test runner can't, an end-to-end check of the built app covers the difference, and the test strategy says so.",
129
+ why: "Tests that run different code from the shipped build pass while the product breaks. A compiler that changes how code runs, such as one that memoises, is exactly where they differ.",
130
+ ask: "Does the test setup apply every compiler and transform the build does?",
131
+ stage: "mvp",
132
+ check: "ai-review",
133
+ severity: "high",
134
+ },
124
135
  ];
@@ -176,5 +176,22 @@ export const react = {
176
176
  severity: "medium",
177
177
  carries: "PERF-06",
178
178
  },
179
+ {
180
+ id: "REACT-11",
181
+ title: "A hook is called by its own name, never passed around as a value",
182
+ rule: "A hook is called directly, by a name that starts with use. It's never passed as an argument or a prop, stored in a variable or an object, or called through another name.",
183
+ why: "React, and the React Compiler, know a hook by its name. A hook called through another name may be memoised or skipped, which shifts the order of hooks and breaks the component on a later render.",
184
+ ask: "Is any hook in this change passed, stored or called by a name that doesn't start with use?",
185
+ stage: "prototype",
186
+ check: "auto",
187
+ severity: "high",
188
+ carries: "CODE-16",
189
+ enforcer: { tool: "eslint", rule: "react-hooks/hooks" },
190
+ examples: {
191
+ file: "example.tsx",
192
+ fails: 'import { useState } from "react";\nfunction useBay(): string {\n const [bay] = useState("Bay 1");\n return bay;\n}\nfunction useLatest(read: () => string): string {\n return read();\n}\nexport function Booking() {\n const bay = useLatest(useBay);\n return <p>{bay}</p>;\n}\n',
193
+ passes: 'import { useState } from "react";\nfunction useBay(): string {\n const [bay] = useState("Bay 1");\n return bay;\n}\nexport function Booking() {\n const bay = useBay();\n return <p>{bay}</p>;\n}\n',
194
+ },
195
+ },
179
196
  ],
180
197
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "peer-ai-standards",
3
- "version": "1.0.0-next.13",
3
+ "version": "1.0.0-next.15",
4
4
  "description": "Peer AI's engineering standards: 197 rules for every project, and stack profiles with the tools that enforce them",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -11,7 +11,7 @@
11
11
  }
12
12
  },
13
13
  "dependencies": {
14
- "peer-ai-workflow": "1.0.0-next.13",
14
+ "peer-ai-workflow": "1.0.0-next.15",
15
15
  "zod": "4.6.5"
16
16
  },
17
17
  "engines": {