ESM config compatibility for vitest - #1397
Conversation
⚡️ Codeflash found optimizations for this PR📄 11% (0.11x) speedup for
|
PR Review SummaryPrek Checks✅ All checks pass — Mypy
Code ReviewKey changes in this PR:
Outstanding issue (from previous review):
No new critical issues found. Test Coverage
Notes:
Last updated: 2026-02-09T15:15Z |
| return True | ||
| if import_path.endswith((source_name, "/" + source_name)): | ||
| return True |
There was a problem hiding this comment.
Low risk, but worth noting: The endswith(source_name) match on the stem alone is quite broad. If the source file is named something common like utils.ts or index.ts, this could match unrelated imports (e.g., some/other/utils would also get rewritten to the relative path of this source file).
Consider either:
- Adding a check that the import path shares more path segments with the source, or
- Requiring a stricter match (e.g., matching the last 2 path segments)
No description provided.