fix(types): eliminate all any types and add error type narrowing#35
fix(types): eliminate all any types and add error type narrowing#35namastex888 merged 1 commit intodevfrom
Conversation
- Replace `as any` with proper type casts (KnownProvider, TextContent, etc.) - Change all `catch (err: any)` / `catch (err)` to `catch (err: unknown)` with instanceof guards - Narrow GeminiConfig.thinkingLevel from `string | null` to `ThinkingLevel | null` - Use `unknown` intermediate cast for pi/ai usage.cost access (not in public types) - Zero `any` annotations remaining in src/
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
anytype annotations acrosssrc/getModel():as any→as KnownProvider/as neveras any→as unknown as Record<string, unknown>withTextContenttype guardusage.cost:as any→as unknown as Record<string, unknown>(not in pi/ai public types)thinkingLevel: narrowed fromstring | nulltoThinkingLevel | nullin GeminiConfigreplContext:as any→ proper REPLStartOptions typecatch (err: any)/catch (err)→catch (err: unknown)withinstanceof ErrorguardsValidation
tsc --noEmitpasses with zero errorsgrep -rn 'as any\|: any\|catch (err)' src/returns zero matches (excluding scaffold.ts template)Replaces #27 (closed as stale — wrong base branch)