Core: Fix resolveImport TSX fallback#34815
Conversation
|
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)
📝 WalkthroughWalkthroughUpdated the resolveImport function to apply a centralized TypeScript extension fallback mapping for JS-like and JSX imports; the catch path iterates through all mapped TypeScript fallbacks and throws the last fallback error if none resolve. Added Vitest tests exercising the fallback ordering and resolution. ChangesImport Resolution Fallback Enhancement
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
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 |
…tsx-fallback # Conflicts: # code/core/src/common/utils/interpret-files.ts
|
Updated this PR to resolve the current What changed:
Local verification:
|
Fixes #34812
What I did
.tsx,.mtsx, and.ctsxfallbacks whenresolveImport()cannot resolve.js,.mjs, or.cjsimports directly..ts,.mts,.cts) before JSX fallbacks..jsx->.tsxbehavior.Checklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
Manual testing
No manual browser testing was necessary; this change is limited to the
resolveImport()utility and is covered by targeted unit tests.Documentation
MIGRATION.MD
AI assistance disclosure
This PR was implemented with assistance from OpenAI Codex.
Summary by CodeRabbit
Tests
Bug Fixes
Written by an agent (Hermes Agent, gpt-5.5).