-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Enhancement Request
The automatic project detection in detectTypeScriptImportExtension currently reads tsconfig.json directly but does not resolve the extends field. This means projects using base configurations (e.g., "extends": "@tsconfig/node18/tsconfig.json") won't have their moduleResolution detected if it's defined in the parent config.
Background
Introduced in PR #344, the basic detection works for many cases where moduleResolution is directly in tsconfig.json. However, many real-world TypeScript projects use base configurations via the extends field.
Scope
Add recursive tsconfig resolution to:
- Read the
extendsfield fromtsconfig.json - Load and parse the base config (can be a local file or npm package)
- Merge
compilerOptionswith proper precedence (child overrides parent) - Support multiple levels of inheritance (base can extend another base)
Example Use Cases
Projects using:
@tsconfig/node18,@tsconfig/node20, etc../tsconfig.base.jsonin monorepos- Custom shared configs
Implementation Notes
- Handle both relative paths (
./tsconfig.base.json) and npm packages (@tsconfig/node18/tsconfig.json) - Use proper Node.js resolution for npm packages
- Implement proper merge logic (arrays override, objects shallow merge)
- Add tests for common scenarios
Related
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request