127
128
These passes already accumulate errors internally and return `Result<void, CompilerError>`. The change is: instead of returning the Result, record errors on `env` and return void. Remove the `.unwrap()` call in Pipeline.ts.
129
130
-- [ ] **4.1 `validateHooksUsage`** (`src/Validation/ValidateHooksUsage.ts`)
130
+- [x] **4.1 `validateHooksUsage`** (`src/Validation/ValidateHooksUsage.ts`)
131
- Change signature from `(fn: HIRFunction): Result<void, CompilerError>` to `(fn: HIRFunction): void`
132
- Record errors on `fn.env` instead of returning `errors.asResult()`
133
- Update Pipeline.ts call site (line 211): remove `.unwrap()`
134
135
-- [ ] **4.2 `validateNoCapitalizedCalls`** (`src/Validation/ValidateNoCapitalizedCalls.ts`)
135
+- [x] **4.2 `validateNoCapitalizedCalls`** (`src/Validation/ValidateNoCapitalizedCalls.ts`)
136
- Change signature to return void
137
- Fix the hybrid pattern: the direct `CallExpression` path currently throws via `CompilerError.throwInvalidReact()` — change to record on env
138
- The `MethodCall` path already accumulates — change to record on env
139
- Update Pipeline.ts call site (line 214): remove `.unwrap()`
140
141
-- [ ] **4.3 `validateUseMemo`** (`src/Validation/ValidateUseMemo.ts`)
141
+- [x] **4.3 `validateUseMemo`** (`src/Validation/ValidateUseMemo.ts`)
142
- Change signature to return void
143
- Record hard errors on env instead of returning `errors.asResult()`
144
- The soft `voidMemoErrors` path already uses `env.logErrors()` — keep as-is or also record
145
- Update Pipeline.ts call site (line 170): remove `.unwrap()`
146
147
-- [ ] **4.4 `dropManualMemoization`** (`src/Inference/DropManualMemoization.ts`)
147
+- [x] **4.4 `dropManualMemoization`** (`src/Inference/DropManualMemoization.ts`)
148
- Change signature to return void
149
- Record errors on env instead of returning `errors.asResult()`
150
- Update Pipeline.ts call site (line 178): remove `.unwrap()`
151
152
-- [ ] **4.5 `validateNoRefAccessInRender`** (`src/Validation/ValidateNoRefAccessInRender.ts`)
152
+- [x] **4.5 `validateNoRefAccessInRender`** (`src/Validation/ValidateNoRefAccessInRender.ts`)
153
- Change signature to return void
154
- Record errors on env instead of returning Result
155
- Update Pipeline.ts call site (line 275): remove `.unwrap()`
156
157
-- [ ] **4.6 `validateNoSetStateInRender`** (`src/Validation/ValidateNoSetStateInRender.ts`)
157
+- [x] **4.6 `validateNoSetStateInRender`** (`src/Validation/ValidateNoSetStateInRender.ts`)
158
- Change signature to return void
159
- Record errors on env
160
- Update Pipeline.ts call site (line 279): remove `.unwrap()`
161
162
-- [ ] **4.7 `validateNoImpureFunctionsInRender`** (`src/Validation/ValidateNoImpureFunctionsInRender.ts`)
162
+- [x] **4.7 `validateNoImpureFunctionsInRender`** (`src/Validation/ValidateNoImpureFunctionsInRender.ts`)
163
- Change signature to return void
164
- Record errors on env
165
- Update Pipeline.ts call site (line 300): remove `.unwrap()`
166
167
-- [ ] **4.8 `validateNoFreezingKnownMutableFunctions`** (`src/Validation/ValidateNoFreezingKnownMutableFunctions.ts`)
167
+- [x] **4.8 `validateNoFreezingKnownMutableFunctions`** (`src/Validation/ValidateNoFreezingKnownMutableFunctions.ts`)
168
- Change signature to return void
169
- Record errors on env
170
- Update Pipeline.ts call site (line 303): remove `.unwrap()`
171
172
-- [ ] **4.9 `validateExhaustiveDependencies`** (`src/Validation/ValidateExhaustiveDependencies.ts`)
172
+- [x] **4.9 `validateExhaustiveDependencies`** (`src/Validation/ValidateExhaustiveDependencies.ts`)
173
- Change signature to return void
174
- Record errors on env
175
- Update Pipeline.ts call site (line 315): remove `.unwrap()`