fix: remove redundant non-null assertions in ezoic.ts#1091
fix: remove redundant non-null assertions in ezoic.ts#1091yoloni-9527 wants to merge 1 commit intof:mainfrom
Conversation
The ??= operator already guarantees that `ez` is non-null by the time it is assigned, so the subsequent non-null assertions (!.) on `ez.cmd` are redundant and can be safely removed. Before: ez!.cmd = ez!.cmd || []; ez!.cmd.push(fn); After: ez.cmd = ez.cmd || []; ez.cmd.push(fn);
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughA single file refactoring removes non-null assertions ( Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 Tip CodeRabbit can use TruffleHog to scan for secrets in your code with verification capabilities.Add a TruffleHog config file (e.g. trufflehog-config.yml, trufflehog.yml) to your project to customize detectors and scanning behavior. The tool runs only when a config file is present. |
Summary
Hi there! 👋 Thanks for building and open-sourcing this project — really appreciate it.
I noticed a small TypeScript improvement opportunity in
src/lib/ezoic.ts.Problem
The
??=(nullish assignment) operator already guarantees thatezis non-null after assignment, so the non-null assertions (!) on the following lines are redundant:The
!operator suppresses TypeScript's type checker unnecessarily, which can mask real issues in the future.Fix
Impact
!non-null assertionsHappy to adjust anything if needed. Thanks again for the great project! 🙏
Summary by CodeRabbit