microsoft / microsoft/TypeScript
Issues trying to auto-import across project boundaries
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
TypeScript Version: 3.2.2, 3.3.0-rc
Search Terms: autoimport, project references, autocomplete
Code
Full minimal repro: https://github.com/MLoughry/typescript-repro
See src/a/lib/index.ts
// If another file in the project already has an import from the other project,
// then attempting to auto-import `bar` will prompt you to import from 'obj/b/lib'
// If no other import is found within the project, no auto-import suggestions are found
console.log(bar);
Expected behavior:
Auto-import should work across project boundaries when an outDir is specified (with or without paths specified in tsconfig.json)
Actual behavior:
- If there is already a cross-project import within the project: The auto-import attempts to import from the outDir.

- If there is no other cross-project import within the project: No import suggestions are found.

Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked minimal reproduction and src/a/lib/index.ts, then inspect the project-reference and tsconfig.json setup, including outDir and paths. Compare auto-import behavior when a cross-project import already exists with behavior when it does not; done means suggestions work across project boundaries without importing from the outDir.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- developer-experience
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100