fix(config): preserve rewriteRelativeImportExtensions setting#5213
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
💤 Files with no reviewable changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughRemoved the forced override that set Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/legacy/config/config-set.spec.ts`:
- Around line 71-98: The test in src/legacy/config/config-set.spec.ts is too
weak: after calling getParsedTsconfig(...) and extracting options, the assertion
expect(options.rewriteRelativeImportExtensions).not.toBe(false) can pass if the
property is missing; change it to assert the actual preserved value by using
expect(options.rewriteRelativeImportExtensions).toBe(true) so the test verifies
that rewriteRelativeImportExtensions set to true in the input remains true in
the parsed options (reference getParsedTsconfig and the options object).
In `@src/legacy/config/config-set.ts`:
- Around line 180-181: Current code leaves rewriteRelativeImportExtensions:
undefined inside _overriddenCompilerOptions which still overrides and clears a
user-supplied true; remove the rewriteRelativeImportExtensions entry entirely
from the _overriddenCompilerOptions object in config-set (do not set it to
undefined) so the user tsconfig value is preserved, and ensure the code path
that prunes compiler options (the block that deletes options with forced
undefined) is relied on instead of keeping this key.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 7a9e29cb-289c-4c34-aace-a779fc415dae
📒 Files selected for processing (2)
src/legacy/config/config-set.spec.tssrc/legacy/config/config-set.ts
|
Thanks for the review — I applied both suggestions:\n\n- removed the key from (instead of setting it to )\n- tightened the test assertion to so it verifies preservation explicitly\n\nValidation run:\n- ✅ |
|
Thanks for the review — addressed both actionable points in 628bd61:
Validation run:
|
Summary
rewriteRelativeImportExtensionstofalseinConfigSetcompiler overrides.mtsimports are not rewritten into TS5097 failuresFixes #5196
Test plan
npx jest -c=jest.config.ts src/legacy/config/config-set.spec.ts -t "preserve rewriteRelativeImportExtensions"Does this PR introduce a breaking change?
Other information
Summary by CodeRabbit
Bug Fixes
Tests