Commit a958621
feat: enhanced typescript options (#100)
* chore(typescript): add enhanced compiler options
Add 5 strict TypeScript compiler options to improve type safety:
- noUncheckedIndexedAccess: Ensures array access returns T | undefined
- useUnknownInCatchVariables: Catch variables typed as unknown
- allowUnreachableCode: Disallow unreachable code
- allowUnusedLabels: Disallow unused labels
- noImplicitOverride: Require explicit override keyword
Applied across all packages (api, app, tricorder) for consistent
type safety standards.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* fix(api): resolve type errors from enhanced TypeScript options
Fix ~100 type errors across API routers to comply with stricter
TypeScript configuration:
- Add non-null assertions after explicit runtime checks
- Use optional chaining for regex match groups
- Add explicit null checks for database .returning() calls
- Extract pagination params to preserve Zod default values
- Fix array access patterns with length guards
All changes maintain runtime safety while satisfying strict type
checking. No behavior changes.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* refactor(api): extract shared schemas and helpers in admin router
Reduce code duplication in admin.ts by extracting reusable components:
- Extract blockedDomainReasonSchema (used 8 times, saves ~60 lines)
- Extract planOutputSchema (used 2 times, saves ~12 lines)
- Extract globalSettingsOutputSchema
- Add transformAdminUser() helper (saves ~60 lines)
- Add formatGlobalSettings() helper (saves ~13 lines)
Net reduction: 56 lines removed (278 deleted, 222 added)
All tests passing, no behavior changes.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent 125bf83 commit a958621
File tree
15 files changed
+400
-326
lines changed- packages
- api
- src
- cli
- hono
- routers
- services/feed-discovery
- types
- utils
- app
- tricorder
- src/services
15 files changed
+400
-326
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
307 | 307 | | |
308 | 308 | | |
309 | 309 | | |
310 | | - | |
| 310 | + | |
311 | 311 | | |
0 commit comments