microsoft / microsoft/TypeScript
Broken autoimport of module without index reexport
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
Demo: https://github.com/zerkalica/ts-references-autoimport-bug/tree/no-autoimport-wo-index
TypeScript Version: 4.0.2
VSCode Version: 1.49.2
OS: Ubuntu 20.04.1 LTS
Example 1
Package 'b' depends on 'a', but 'a' has no index.ts and types in package.json.
Steps to reproduce
- clone, switch to no-autoimport-wo-index, yarn install
- Open lib/b/b.ts in vscode, type
someA - Expected: autoimport suggest
import { someA } from '@some/lib-a/a', actual: no autoimport
Example 2
Package 'd' depends only on 'c', 'c' depends on 'a', but 'a' has no index.ts and types in package.json.
Steps to reproduce
- clone, switch to no-autoimport-wo-index, yarn install
- Open lib/d/d.ts in vscode, type
someA - Expected: no someA in autoimport, actual: autoimport suggests broken
import { someA } from '../a/a'
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
Clone the linked no-autoimport-wo-index branch, run yarn install, and reproduce both cases in lib/b/b.ts and lib/d/d.ts. Compare the actual and expected autoimport suggestions, including the package.json type declarations, and consider the issue complete when Example 1 suggests @some/lib-a/a while Example 2 does not suggest the broken relative import.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- developer-experience, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100