microsoft / microsoft/TypeScript

import fix / autocomplete requires type checking JS/JSX

Open
#36,134 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Awaiting More Feedback Suggestion
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.