microsoft / microsoft/TypeScript
Automatic Type Acquisition should give the ability to prioritize jsconfig.json types over node_modules types
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
Feature request
Visual Studio Code should download @types/jest with this jsconfig.json configuration :
{
"typeAcquisition": {
"include": [
"jest"
]
}
}
But Automatic Type Acquisition give priority to Jest types coming from node_modules :
[23:20:24.533] Explicitly included types: ["jest"]
[23:20:24.534] Typing names in '/data/www/jest-vscode-ata/package.json' dependencies: ["jest"]
[23:20:24.578] Searching for typing names in /data/www/jest-vscode-ata/node_modules; all files: [...]
[23:20:24.632] Package 'jest' provides its own types.
Provided Jest types seems to be useless and they are not globally available. Automatic Type Acquisition should give the ability to prioritize jsconfig.json configuration over node_modules types.
Configuration
- VSCode Version: 1.43.2
- OS Version: Debian 10 / Xfce 4.12
Demo repository
- Clone Git repository with following command git clone https://github.com/cedricmn/jest-vscode-ata.git
- Go to project folder and type npm install
- Open index.test.js with Visual Studio Code
- IntelliSense for Jest does not works
Workaround
- Installing @types/jest as dev dependency fix the issue but typing should be Automatic Type Acquisition responsibility
- Installing Jest globally and removing it from dev dependency fix the issue but Jest should be listed as dev dependency
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 Automatic Type Acquisition behavior described in the issue, the jsconfig.json typeAcquisition.include setting, and the demo repository's npm install and index.test.js reproduction. Trace how explicitly included Jest types are resolved against node_modules; done means the configuration can prioritize the requested types and IntelliSense works in the demo.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript, vscode
- Domain
- developer-experience, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100