microsoft / microsoft/TypeScript
import fix / autocomplete requires type checking JS/JSX
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
Extracted issue from https://code.visualstudio.com/docs/nodejs/working-with-javascript#_type-checking-javascript
Auto complete of imports in JS/JSX files does not work properly unless type checking of JS/JSX files is explicitly enabled. This is counter intuitive, and forces the user to endure potentially unwanted type errors in order to have working autocomplete of imports.
It's extra confusing because the autocomplete does work for symbols exported from modules that are already imported (so it seems like it should work but is flaky). It took me a long time to find this problem.
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 TypeScript documentation on JavaScript type checking and reproduce import autocomplete in JS/JSX with type checking disabled. Trace the language-service behavior for imports and compare it with symbols from already-imported modules. Done means import autocomplete works without requiring type checking or producing unwanted type errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- developer-experience, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100