Repository navigation
Skip the export check for shorthand ambient modules - #111
Conversation
A project shim such as `declare module 'lucide-react';` types every import from that module as any, so TypeScript accepts any name. The checker resolves the import to the shim, getExportsOfModule returns nothing, and every imported name was reported as a critical hallucinated_import: 825 false findings on a Next.js app with shims for lucide-react and @radix-ui/react-slot, enough to fail --strict. Fixes #100 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
|
Caution Review failedThe pull request is closed. Walkthrough
Merge Risk:
|
|
User description
Fixes #100.
A project shim such as
declare module 'lucide-react';types every import from that module asany, so TypeScript accepts any name. KarpeSlop's checker resolved the import to the shim and found no exports. It then reported every imported name as a criticalhallucinated_import.This PR skips the export check when a module is declared with a bodiless
declare module 'x';.Impact
TruckFull (210k-line Next.js app with shims for
lucide-reactand@radix-ui/react-slot),--quiet:The 20 that remain are real: a missing
@/hooks/useAuth, plus prototypes in a gitignoredtmp/folder (#101).Testing
npm testpasses all 158 tests, and the typecheck is clean./review(reviewer on Haiku 5.5): PASS. Two P3 notes are filed as a follow-up issue.🤖 Generated with Claude Code
CodeAnt-AI Description
Stop false missing-import errors for shimmed modules
What Changed
declare module 'x';no longer trigger false missing-export findings, since TypeScript accepts any import name from these modules.Impact
✅ Fewer false import errors in projects with module shims✅ Strict checks no longer fail because of these shims💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.
Summary by CodeRabbit
any.