unguard 0.12.0 → 0.12.1

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/README.md CHANGED
@@ -145,9 +145,16 @@ These rules use the TypeScript type checker. Non-nullable types suppress the dia
145
145
 
146
146
  | Rule | Severity | What it catches |
147
147
  | ---- | -------- | --------------- |
148
+ | `no-inline-param-type` | warning | `(params: { id: string; ... })` — inline object type on parameter |
148
149
  | `prefer-default-param-value` | info | Optional param reassigned with `??` in the body |
149
150
  | `prefer-required-param-with-guard` | info | `arg?: T` followed by `if (!arg) throw` |
150
151
 
152
+ ### State management
153
+
154
+ | Rule | Severity | What it catches |
155
+ | ---- | -------- | --------------- |
156
+ | `no-module-state-write` | warning | Function mutates a module-scope binding (`count++`, `state.ready = ...`, `cache.set(...)`) |
157
+
151
158
  ### Cross-file analysis
152
159
 
153
160
  | Rule | Severity | What it catches |
@@ -186,6 +193,15 @@ type AnyNode = Record<string, any>;
186
193
  file.ts:2:31 error Explicit `any` annotation ... (intentional escape hatch for untyped AST access)
187
194
  ```
188
195
 
196
+ For `warning` and `info` diagnostics, you can explicitly mark a finding as intentional with `@unguard <rule-id>` on the same line or immediately above:
197
+
198
+ ```typescript
199
+ // @unguard no-module-state-write module cache is intentional in this adapter
200
+ cache.set(user.id, user);
201
+ ```
202
+
203
+ `@unguard` never suppresses `error` diagnostics.
204
+
189
205
  ## API
190
206
 
191
207
  ```typescript